How can I set my draggable constraint proportions once I already zoomed in and the base layer is scaled * 2???
These are really hard to answer without a small example I'm afraid. If I had to make a wild guess I think you would have to account the constraints for scale (so * 2 everything) and optionally account for the origin (which influences the position with scale).
it's the origin part that is tricky
will upload a small version of the prototype
Screen.backgroundColor = "#fff"
base = new Layer x: 0 y: 0 width: Screen.width height: Screen.height backgroundColor: '#f2f2f3'
testSize = 100test = new Layer parent: base x: (Screen.width / 2) - (testSize /2) y: (Screen.height / 2) - (testSize /2) backgroundColor: 'red' width: testSize height: testSize
# pinch settingsbase.pinchable.rotate = falsebase.pinchable.enabled = truebase.pinchable.centerOrigin = truebase.pinchable.minScale = 1base.pinchable.maxScale = 2.1
# drag settingsbase.draggable.enabled = truebase.draggable.propagateEvents = falsebase.draggable.constraints = basebase.draggable.overdrag = true
# pinch Startbase.on Events.PinchStart, (event, layer) -> startPinch = event.scale
# pinch Startbase.on Events.Pinch, (event, layer) ->
# pinch Endbase.on Events.PinchEnd, (event, layer) -> base.animate properties: scale: 2 base.onAnimationEnd -> base.draggable.constraints = base * 2
here's a basic version of what I am trying to do