xScale and yScale effecting touch listener

I had noticed that if I create an event listener that the location of event.x or event.y doesn’t scale along with the smaller scale. I was wondering if there was some sort of fix or workaround for it. 

 local function listener( event ) if ( event.phase == "began" ) then display.getCurrentStage():setFocus( event.target ) elseif ( event.phase == "moved" ) then line.x = event.x elseif ( event.phase == "ended" or event.phase == "cancelled" )then display.getCurrentStage():setFocus(nil) end end touch:addEventListener( "touch", listener )

Hi @lofy,

What is the object “touch”? I see you added a listener to it, but I’m not sure what that actual object is…

Brent

touch is just a Rect with a width of 300 and height of 100, the line is just a Line with a height of 100

Hi @lofy,

What is the object “touch”? I see you added a listener to it, but I’m not sure what that actual object is…

Brent

touch is just a Rect with a width of 300 and height of 100, the line is just a Line with a height of 100