-
Notifications
You must be signed in to change notification settings - Fork 22
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
Transfer the logic of enabling/disabling pan and zoom to the gesture handler #110
base: main
Are you sure you want to change the base?
Transfer the logic of enabling/disabling pan and zoom to the gesture handler #110
Conversation
4ac6b8b
to
3a52815
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks really good. The main thing is the one comment for enabling pan consume - it seems to not agree with what the code is doing?
event.consumeChangedPositions() | ||
if (zoomAllowed) { | ||
val centroid = event.calculateCentroid(useCurrent = false) | ||
onZoomChange(size, centroid, ZoomFactor(zoomChange, zoomChange)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can zoomFactor(zoomChange, zoomChange)
be replaced with the val zoom
created above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section will be changed soon, as a panning animation for iOS/Android will be added.
(Actually, the animation implementation is already ready, but unfortunately I can't do cascading PR here, so I'm waiting for the current PR to be accepted)
/** | ||
* Whether the pan gesture on the X-axis should be consumed (handled). Has no effect for `js` and `wasmJs` | ||
* If `true`, the pan gesture will be consumed and will not propagate further | ||
* However, the gesture will still be processed but `PointerInputChange#consume` will not be called, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like from the code, that change.consume()
IS being called when this value is true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, you're absolutely right, thanks! :)
3a52815
to
5ed060a
Compare
As part of these changes:
from the parent container