Simple-Draw
Simple-Draw copied to clipboard
Zoom towards the center of the screen
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.
(forgot to remove the Log import I was using to help debug - fixed now)
@tibbi, Sorry to nag - but its been a week and I was wondering on the likelihood of this being merged? Thanks
I havent been working on this app lately, will take a look at it once Im here. I dont want to jump around everywhere. Thanks
That makes perfect sense, thanks for the update :)
sorry but this is too glitchy, it is jumping around. You can easily move the canvas with panning gestures, so I think it works well as it is. Thanks though
~~I found it to be perfectly fine?? No jumping or anything. I will test on a few other devices~~ Totally was not fine. Should really test code more before sending a PR.
BTW @tibbi, I did get this fixed. The main problem with what I had done is due to the limits on zooming - it caused odd jumpy behaviour as you described.
I currently have a fork over at CactiChameleon9/Simple-Drawish which includes this fix and a few other things.
See a74f4b8bb967f182606dee1de8501b19720a3368 and 8809286d370eb72e09143d872d0471fe57d4f08e for the implementation (note I have increased the min/max zoom, so you may way to use your original values)
I can format and send a single commit PR to simple draw if you wish?
ye, create a new PR for easy testing please
@tibbi Done! BTW - would you like me to make a PR for any of the other features I listed in the CactiChameleon9/Simple-Drawish README.md
I already know you are not interested in a full screen option.
well, if something is reported and marked as bug/feature, you can create a PR for it