Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better pinch-to-zoom #2786

Closed
jsfan3 opened this issue May 7, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@jsfan3
Copy link
Contributor

commented May 7, 2019

Thank you for your support.

I replied to your comment to my question about the new cropping feature:
https://stackoverflow.com/questions/56013760/generalize-code-to-capture-and-crop-a-photo?noredirect=1#comment98673887_56013760

On real devices, the ImageViewer cropping works, but the pinch-to-zoom doesn't work very well: on Android 7, at the end of the pinch-to-zoom the image is sometimes moved to the top-left corner or the bottom-right corner without reason; on iPhone X, the pinch-to-zoom seems not fluid and, when the zoom is big, the image becomes all black (it returns visible reducing the zoom).

Could you please make the pinch-to-zoom working better?

The code that I used is the one reported in the link above.

@codenameone codenameone added this to the Version 7.0 milestone May 7, 2019

@codenameone

This comment has been minimized.

Copy link
Owner

commented May 7, 2019

That might be a regression due to a recent PR that included support for tap to zoom. It might be misfiring since multi-touch is a bit fragmented between devices.

shannah added a commit that referenced this issue May 7, 2019

Added pinchReleased() method to Component so that subclasses can dete…
…ct the case where a pinch zoom has ended by the user removing one of the fingers. This only fires when the drag is continuing. This improves the UX in the ImageViewer when performing pinch zoom as described in #2786
@shannah

This comment has been minimized.

Copy link
Collaborator

commented May 7, 2019

The Android issue is fixed. This fix affects all devices.

I'm currently having some difficulties with my iOS development environment so haven't been able to look at iOS yet.

@shannah

This comment has been minimized.

Copy link
Collaborator

commented May 7, 2019

I've tested on iOS now. In response to your observations:

the pinch-to-zoom seems not fluid

I see what you mean. Panning is smooth. Pinch zoom is a little bit choppy. IMO still quite usable. I'll see what I can do to improve this.

when the zoom is big, the image becomes all black

This happens when the image size crosses the device's max texture size threshold. On iOS, images get rendered as OGL textures. Working on fixing this now.

@jsfan3

This comment has been minimized.

Copy link
Contributor Author

commented May 7, 2019

Thank you

@shannah shannah closed this in e1ffd1c May 7, 2019

@shannah

This comment has been minimized.

Copy link
Collaborator

commented May 7, 2019

Both the "black" image issue and the "choppiness" issue is now fixed in iOS. It will be available in the next update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.