You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ive been working on a feature that allows you to place markers on an image along with the ability to zoom & pan the image.
I have all working as expected when the scale is "1", However once scale increases the marker is not placed in the correct location. Currently I adjust the translation based on the scale to get the point relative to the centre of the canvas when placing a new marker. The Y axis is correct however the X axis is not.
My assumption is that the aspect ratio of the canvas is affecting this. But I can't figure out how to apply the aspect ratio to get the correct position.
Code here (It doesn't seem to work unless run on your machine)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Ive been working on a feature that allows you to place markers on an image along with the ability to zoom & pan the image.
I have all working as expected when the scale is "1", However once scale increases the marker is not placed in the correct location. Currently I adjust the translation based on the scale to get the point relative to the centre of the canvas when placing a new marker. The Y axis is correct however the X axis is not.
My assumption is that the aspect ratio of the canvas is affecting this. But I can't figure out how to apply the aspect ratio to get the correct position.
Code here (It doesn't seem to work unless run on your machine)
Beta Was this translation helpful? Give feedback.
All reactions