Closed Pidroh closed 5 years ago
Interesting... what kind of scaling are we talking about here? There already is a scaling compensation applied (previous two lines) that works for CSS-based width/height. I suppose this one tackles CSS transformations (the scale()
function in particular)?
Yes, exactly. I've been having some trouble getting the size just right on mobile... My problems are more likely to be related to a lack of CSS experience, but I ended up using scaling to solve the problem. I thought it would be useful so I submitted it, but since after all of these years no one has brought the issue to light, maybe it's not so important.
@Pidroh perhaps you would be able to solve your mobile sizing using CSS width
/height
properties instead of applying transforms?
I will try to setup a testing scenario that accounts for all possible sizing approaches, so that I can figure out a simpler coordinate transformation that is not based on a particular CSS property.
I believed I fixed the issue by actually simplifying the original code :)
Thanks for the suggestion, bugreport and pull request!
Previously mouse position would come wrong if the canvas was scaled. The two lines added resolve this issue