Permalink
Browse files

Fix point conversion on Chrome

  • Loading branch information...
koenbok committed Jul 19, 2016
1 parent 997b336 commit 7143e640482a41f56a621ecffb761bc6c272d413
@@ -37,3 +37,6 @@ app.js
framer/images/*
framer/framer*.js
framer/framer*.js.map
.preview.html
.viewer.html
@@ -1,44 +1,4 @@
scroll = new ScrollComponent
name: "MainScroll"
height: Framer.Screen.height
width: Framer.Screen.width
scrollHorizontal: false
directionLock: true
backgroundColor: 'white'
layer = new Layer
size: Screen.size
rows = []
for i in [0...4]
row = new Layer
height: 400
width: 400
x: 25
y: 25 + 425 * i
parent: scroll.content
backgroundColor: 'white'
name: "row#{i}"
rows.push(row)
for row in rows
storyScroll = new ScrollComponent
name: "StoryScroll"
height: 400
width: Framer.Screen.width
x: 0
y: 0
parent: row
backgroundColor: 'white'
scrollVertical: false
directionLock: true
name: "units#{row.index}"
# Add story units
for i in [0..4]
unit = new Layer
width: 400
height: 400
parent: storyScroll.content
x: 425 * i
backgroundColor: Utils.randomColor()
name: "unit#{i}"
layer.onTap (e) -> print e.point
@@ -340,6 +340,9 @@ class exports.Context extends BaseClass
return unless @_element
@_element.style["z-index"] = value
ancestors: (args...) ->
return @_parent?.ancestors(args...) or []
toInspect: ->
round = (value) ->
@@ -328,8 +328,9 @@ class exports.GestureInputRecognizer
_getGestureEvent: (event) ->
eventPoint = Utils.convertPoint(
@_getEventPoint(event), null, Framer.CurrentContext, true)
# Convert the point to the current context
eventPoint = Utils.convertPointFromContext(
@_getEventPoint(event), Framer.CurrentContext, true, false)
_.extend event,
time: Date.now() # Current time √
@@ -1002,8 +1002,10 @@ Utils.convertPointFromContext = (point = {}, layer, rootContext=false, includeLa
ancestors = layer.ancestors(rootContext)
ancestors.reverse()
ancestors.push(layer) if includeLayer
for ancestor in ancestors
point = ancestor.matrix3d.inverse().point(point)
return point
# convert a frame from the context level to a layer, with rootContext enabled you can make it start from the top context

0 comments on commit 7143e64

Please sign in to comment.