-
Notifications
You must be signed in to change notification settings - Fork 4
Drag Handles
amitp edited this page Sep 13, 2010
·
13 revisions
The combination of Draggable.as and Model.as provide drag handles. Here’s a demo showing continuous control of the size and discrete (stepped) control over the angle. In addition, there’s a minimum and maximum size allowed:
The corresponding code constructs a drag handle that decomposes its position into radius (controlling size) and angle (controlling rotation angle):
new Draggable( Model.Polar(Model.ref(area, 'scaleX') .callback(function():void { area.scaleY = area.scaleX; }) .clamped(0.2, 1.0) .multiply(100), Model.ref(area, 'rotation') .rounded(15) .multiply(Math.PI/180) ).offset(new Point(200, 200)) );