Skip to content

Adjust delta calculations based on new origin and scale#139

Open
marco00petrucci wants to merge 1 commit into
midzer:productionfrom
marco00petrucci:production
Open

Adjust delta calculations based on new origin and scale#139
marco00petrucci wants to merge 1 commit into
midzer:productionfrom
marco00petrucci:production

Conversation

@marco00petrucci
Copy link
Copy Markdown

When zooming an image, the transform-origin is updated, but deltaX and deltaY are not compensated for this shift. This causes the image to jump/glitch when trying to pan it right after zooming.

Fix
Added a mathematical compensation for the transform-origin shift inside the zoomPan function, just before calling pan(deltaX, deltaY). I also have a video of the bug if needed.

@midzer
Copy link
Copy Markdown
Owner

midzer commented Mar 28, 2026

Thanks for your contribution, @marco00petrucci

Would be nice, if you share your video.

Right now, I don't understand the jump/glitch for pan after zoom.

@marco00petrucci
Copy link
Copy Markdown
Author

Try zooming in and out into the corner of an image with your mouse and you'll see it doesn't work right:
https://github.com/user-attachments/assets/42e26fe9-61f4-4c74-bc73-b1b0420db1c2

@midzer
Copy link
Copy Markdown
Owner

midzer commented Mar 28, 2026

Okies, let me reproduce it locally with and without your patch.

I'll check back then!

@midzer
Copy link
Copy Markdown
Owner

midzer commented Apr 2, 2026

D'oh, I forgot to test your changes and put it in current release.

Please be patient :)

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.

2 participants