Skip to content

Conversation

toamz
Copy link
Contributor

@toamz toamz commented May 29, 2025

Description

Unfortunately I think I broke more things than I fixed in #18569, sorry for not testing it enough.

Fixes #18730 "always zooms towards the image center". Now zooms to the focalPoint.

I am not sure if or where widget.enablePanAlways is true or what it should do in that case, but I believe it should only disable the clamping.

details.focalPoint is relative to top left of the screen, but this.position is relative to the center, which is why I calculate centeredFocalPoint. I didn't find any function that would provide this functionality. The closest one was scaleBoundaries.outerSize.center(origin) but that one adds half of the size instead of subtracting it.

How Has This Been Tested?

  • see screen recording

Screenshots (if appropriate)

Screen recording after the changes:

screen_recording.mp4

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

toamz added 4 commits May 29, 2025 10:24
To properly zoom to current position and pan at the correct speed

TODO: zoom to current pinch position
@alextran1502 alextran1502 changed the title Fix pinch zoom in mobile app fix: pinch zoom in mobile app May 29, 2025
Copy link
Member

@alextran1502 alextran1502 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing it

@alextran1502 alextran1502 enabled auto-merge (squash) May 29, 2025 14:13
@alextran1502 alextran1502 merged commit 0e81c20 into immich-app:main May 29, 2025
42 checks passed
savely-krasovsky pushed a commit to savely-krasovsky/immich that referenced this pull request Jun 8, 2025
* Change photo zoom logic

To properly zoom to current position and pan at the correct speed

TODO: zoom to current pinch position

* zoom to current pinch position

* Clean unused variable

* Formatting

* fix: lint

---------

Co-authored-by: Alex <[email protected]>
waclaw66 added a commit to waclaw66/immich that referenced this pull request Sep 1, 2025
alextran1502 pushed a commit that referenced this pull request Sep 4, 2025
* fix: pinch + move scale

* added lost changes from #18744
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pinch-to-zoom should focus on gesture center, not image center, for intuitive photo viewing on mobile app
2 participants