Skip to content

Instantly share code, notes, and snippets.

@koenbok
Created January 4, 2016 13:12
Show Gist options
  • Select an option

  • Save koenbok/be756fe89c741a88c6de to your computer and use it in GitHub Desktop.

Select an option

Save koenbok/be756fe89c741a88c6de to your computer and use it in GitHub Desktop.
Framer.CurrentContext.perspective = 0
plane = new Layer
width: 200
height: 200
rotationX: Math.random() * 360
rotationY: Math.random() * 360
rotationZ: Math.random() * 360
plane.originX = Math.random() * 1
plane.originY = Math.random() * 1
plane.center()
createHandle = (layer, x, y) ->
size = 10
handle = new Layer
width: size
height: size
backgroundColor: "red"
borderRadius: size / 2
point = layer.calculateMatrixPoint(x:x, y:y)
handle.midX = point.x
handle.midY = point.y
createHandles = (layer) ->
createHandle(layer, 0, 0)
createHandle(layer, 0, layer.height)
createHandle(layer, layer.width, 0)
createHandle(layer, layer.width, layer.height)
createHandles(plane)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment