> As has been done with the dragBoundry code, I suggest that we set up a
> "handle" boundry for a drag event. It would involve testing to see where
> on the layer the mouse clicks and stopping the event if it is outside
> the handle boundry.
>
> I'm willing to put together the code, I'm just seeing if anyone has any
> comments / stones : )
you're lucky, because you don't have to do it yourself. i did this just
yesterday and it was intended to be posted this evening (CET).
i attached the modified dragevent.js-file.
there's one line added in DragEvent.lyrListener.onmousedown, the additional
code is at the end of the document.
sample code:
myLayer = new DynLayer(null,100,100,100,100,'red');
DynAPI.document.addChild(myLayer);
area = new DragArea('rect',0,100,20,0);
DragEvent.addDragArea(myLayer, area);
DragEvent.enableDragEvents(myLayer);
at the moment, two different DragArea-types are supported:
new DragArea('rect',t,r,b,l)
new DragArea('circle',centerX,centerY,radius);
multiple DragAreas can be added, to a layer
if you need more complex areas, you can add them yourself, it shouldn't be
too difficult to understand the code.
--
Michael Buerge
dragevent.zip