I actually needed this too, and had been testing this from one of your
previous posts, I added the code to dragevents.js like this:
replace line 86:
lyr.moveTo(x,y);
with this:
if (!lyr.dragging){
lyr.dragging=true;
lyr.moveTo(x,y);
lyr.dragging=false;
}else{
window.status+="/";
};
The last bit was a test, to see how often "if (!lyr.dragging)" actually
catches a premature drag call, and the answer is surprisingly NEVER.
So the code doesn't actually do anything like this.
So I thought maybe "lyr.dragging=false;" had to be set from an eventlistener
that listens for the move event, so it is only set when the layer has been
moved. So I added this:
DragEvent.lyrListener.onmove=function(e) {
var lyr=e.src;
lyr.dragging=false;
}
But still I couldn't trap any premature drag calls, so although I understand
the logic of the fix, it looks like this is being done by the dragcode quite
effectively already. (or else I made a mistake somewhere)
Richard
----- Original Message -----
From: "Doug Melvin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 18, 2001 2:27 AM
Subject: Re: [Dynapi-Help] Drag responsiveness
> I had the same problem, the solution was to 'cap' the evnts..
>
>
> blah.ondragmove=function(evnt){
> var obj=evnt.getTarget();
> if (!obj.dragging){
> obj.dragging=true;
> // ..
> // do your drag animation hear..
> // ..
> }
> }
>
>
> What this will do is ensure that the eventlistener doesn't try to
> react to more ondragmove events than the client machine can handle.
> So instead of your object being redrawn every time your mousepointer
> passes a pixel, it will be redrawn every 5 pixels
> (an average on slower machines, could be any number)
>
> This in my experience drasticly improved the 'smoothness' of my
> dragg animation
>
> ----- Original Message -----
> From: "Al Byers" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, March 17, 2001 12:45 PM
> Subject: [Dynapi-Help] Drag responsiveness
>
>
> > Are there ways to improve the responsiveness of the drag event? My drag
> > event operation is complex, so the cursor gets way ahead of the
> > movement. I guess I would like to drop events.
> >
> > Al Byers
> >
> >
> > _______________________________________________
> > Dynapi-Help mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/dynapi-help
>
>
> _______________________________________________
> Dynapi-Help mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/dynapi-help
>
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help