Skip to content

Conversation

@CactiChameleon9
Copy link
Contributor

See #242 for previous details:

This helps fix #138 and #166.

The old zoom behaviour means that when you zoom in after moving the canvas, you end up zooming away from what you were recently drawing. In other words, the center of the zoom was at (0, 0) or the original center of the image.

This PR fixes that by adjusting the canvas position based of how much is zoomed so that the zoom is focused towards the center of what you can see (the screen) - fixing any weirdness with the zoom that was after moving.

@tibbi
Copy link
Contributor

tibbi commented Mar 12, 2023

I dont really see what this changes, can you do some videos about it or a better explanation?

@CactiChameleon9
Copy link
Contributor Author

OK, so do the following (on normal SimpleDraw):

  • Open the app
  • Draw a circle
  • Zoom in and out (for comparison)
  • Move the canvas a lot in any direction
  • Draw a triangle
  • Try zooming in/out

You will notice that when zooming, the triangle moves sideways a lot - moving away from whats on screen.

This is because the zoom is zooming towards the centre of the canvas (where we drew our circle)

This PR fixes that by changing the zoom behaviour so that we zoom towards what is in the centre of the screen, not the centre when we first opened the app.

@CactiChameleon9
Copy link
Contributor Author

CactiChameleon9 commented Mar 12, 2023

(I can get a video to you - but I don't think its that clear what I mean)

@tibbi
Copy link
Contributor

tibbi commented Mar 12, 2023

try merging with the latest master if it wasnt the related gesture glitch only

@CactiChameleon9
Copy link
Contributor Author

What do you mean by "try merging with the latest master". What I have just done? ("Merge branch 'SimpleMobileTools:master' into patch-1")

That just made an extra commit for no reason

@CactiChameleon9
Copy link
Contributor Author

And yes, this is completely separate to the gesture glitch.

@tibbi
Copy link
Contributor

tibbi commented Mar 13, 2023

ok, I see. The PR improves the situation, but it still isnt perfect. We should zoom to the center between 2 fingers, not the center of the screen. Thanks though

@tibbi tibbi merged commit 92a74c3 into SimpleMobileTools:master Mar 13, 2023
@CactiChameleon9
Copy link
Contributor Author

ok, I see. The PR improves the situation, but it still isnt perfect. We should zoom to the center between 2 fingers, not the center of the screen. Thanks though

Yeah - it isn't perfect - but it is a massive improvement when taking notes that span a lot of area!

Thanks for merging 🎉

@CactiChameleon9 CactiChameleon9 deleted the patch-1 branch March 13, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

center of two finger zoom should be between the two fingers

2 participants