http://dynapi.sourceforge.net/
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Dynapi Examples - Drag & Snap (SnapX)
Drag & Snap the layers above.
API notes:
Public Methods (Snap):
- [null] enableSnap() & disableSnap()
- [null] setSnapBoundaryTypeDefault([inner|outer|both]) & [inner|outer|both] getSnapBoundaryTypeDefault()
- [null] setSnapBoundaryType([inner|outer|both]) & [snapType] getSnapBoundaryType()
- [null] setSnapBoundaryDefault(b) & [b] getSnapBoundaryDefault()
- [null] setSnapBoundary() or setSnapBoundary(b) or
[null] setSnapBoundary([inner|outer|both],b) or
[null] setSnapBoundary(number,number) or
[null] setSnapBoundary([inner|outer|both],t,r,b,l) or
[null] setSnapBoundary(ti,ri,bi,li,to,ro,bo,lo)
- [Array (t,r,b,l)] getSnapBoundary([inner|outer]) or
[Array (ti,ri,bi,li,to,ro,bo,lo)] getSnapBoundary(both)
- [null] enableStickySnap() & disableStickySnap()
- [null] enableGridSnap() & disableGridSnap()
- [null] setGridSnapSize(b)
BUGS list:
- Dragging a grid snap layer over a sticky snap layer acts like grid snap when it should not.
- Double check & clean up inner & outer corner grid snapping code.
- Add sticky snap support for both sides of the target layer's border (currently inner or outer only).
- Add sticky snap support for upper-right and lower-left corners (i.e. reflective w.r.t. real edge).
- Find a way to make the snapping/resnapping less jittery (i.e. sticky & grid are options).
TODO list:
- Add argument passing to enableSnap() for more compact way to specify snap type [normal|sticky|grid], boundary type [inner|outer|both], grid size (if applicable) and boundary sizes.
- Add a dockable feature.
- Add a "ghost" feature.
dynapi.zip( 791 k)