“action.screen_y” passed to “on_input” becomes incorrect if we move a touch for some distance
Test app:
http://dev.low-entropy.com/static/demos/defold_coors_bug_2/
Steps:
- Open test app in safari or chrome on an iPhone
- Touch app close to screen top, you will see coors like, action.screen_x,y = 480, 1090
- Then touch app close to screen bottom and slowly move it to the same top position, you will see coors like 480, 800
- 1090 - is correct “y” coordinate and 800 is incorrect “y” coordinate
- for horizontal “x” coor all seem fine for some reason…
Code from test app:
panel.gui_script
function on_input(self, action_id, action)
local coors_str = "action.x,y = " .. math.round(action.x) .. ", " .. math.round(action.y)
local coors_str_2 = "action.screen_x,y = " .. math.round(action.screen_x) .. ", " .. math.round(action.screen_y)
gui.set_text(gui.get_node("coors_text"), coors_str)
gui.set_text(gui.get_node("coors_text_2"), coors_str_2)
end
defold version: 1.2.136
Device: iPhone 6
iOS 11.3.1
browser: Safari