-
Notifications
You must be signed in to change notification settings - Fork 28
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
Support overlaying content that zooms with the image. #54
Comments
telephoto/zoomable/src/commonMain/kotlin/me/saket/telephoto/zoomable/ZoomableState.kt Lines 570 to 582 in 792274b
Do you have a video of an app that does this by any chance? I think I mostly understand your usecase but it'd be nice to confirm my assumptions by seeing something in action. |
Ah yep that should! Reading from I think you can see a good example of what I'm looking to do by editing a photo and google photos and using the markup tool to mark on it. |
Got it. I'll try coming up something. 👍
This screen? Or were you referring to this cropping tool? It has an overlay but it does not follow the image. It stays centered. screen-20231110-005723.3.mp4 |
The first one, note that when you draw on the image it tracks when you zoom/pan around. |
Gotcha! |
@evant Wanna try out Lines 78 to 90 in a586a8c
|
Released as part of 0.7.1. |
…1002) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [me.saket.telephoto:zoomable-image-coil](https://togithub.com/saket/telephoto) | dependencies | minor | `0.6.2` -> `0.7.1` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>saket/telephoto (me.saket.telephoto:zoomable-image-coil)</summary> ### [`v0.7.1`](https://togithub.com/saket/telephoto/releases/tag/0.7.1) - Migrated all usages of `Modifier.composed()` to the new [`Modifier.Node` architecture](https://www.youtube.com/watch?v=BjGX2RftXsU). This should help with performance, especially if your app uses multiple zoomable content on the same screen. - [saket/telephoto#54: `ZoomableContentTransformation` now includes additional information about the content's scale: [`ScaleMetadata`](https://togithub.com/saket/telephoto/blob/9bf0937333e240832d5ecaad57bf31825f0d76b7/zoomable/src/commonMain/kotlin/me/saket/telephoto/zoomable/ZoomableContentTransformation.kt#L78-L90), Breaking changes - Reduced the public API surface by replacing all `data` classes with plain classes. These classes still implement `equals` and `hashCode` (thanks to [poko](https://togithub.com/drewhamilton/poko/)), but they no longer offer any `componentN()` or `copy()` functions. Bug fixes - [saket/telephoto#53: Prevent crashes when Compose UI reports the velocity of a gesture to be infinite. - [saket/telephoto#41: Fixed a crash where touch events received after the UI was restored would cause a division by zero error if the layout wasn't measured yet. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
[![Mend Renovate logo banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [me.saket.telephoto:zoomable-image-coil](https://togithub.com/saket/telephoto) | `0.6.2` -> `0.7.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/me.saket.telephoto:zoomable-image-coil/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/me.saket.telephoto:zoomable-image-coil/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/me.saket.telephoto:zoomable-image-coil/0.6.2/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/me.saket.telephoto:zoomable-image-coil/0.6.2/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [me.saket.telephoto:zoomable-image](https://togithub.com/saket/telephoto) | `0.6.2` -> `0.7.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/me.saket.telephoto:zoomable-image/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/me.saket.telephoto:zoomable-image/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/me.saket.telephoto:zoomable-image/0.6.2/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/me.saket.telephoto:zoomable-image/0.6.2/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [me.saket.telephoto:zoomable](https://togithub.com/saket/telephoto) | `0.6.2` -> `0.7.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/me.saket.telephoto:zoomable/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/me.saket.telephoto:zoomable/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/me.saket.telephoto:zoomable/0.6.2/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/me.saket.telephoto:zoomable/0.6.2/0.7.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>saket/telephoto (me.saket.telephoto:zoomable-image-coil)</summary> ### [`v0.7.1`](https://togithub.com/saket/telephoto/releases/tag/0.7.1) - Migrated all usages of `Modifier.composed()` to the new [`Modifier.Node` architecture](https://www.youtube.com/watch?v=BjGX2RftXsU). This should help with performance, especially if your app uses multiple zoomable content on the same screen. - [saket/telephoto#54: `ZoomableContentTransformation` now includes additional information about the content's scale: [`ScaleMetadata`](https://togithub.com/saket/telephoto/blob/9bf0937333e240832d5ecaad57bf31825f0d76b7/zoomable/src/commonMain/kotlin/me/saket/telephoto/zoomable/ZoomableContentTransformation.kt#L78-L90), Breaking changes - Reduced the public API surface by replacing all `data` classes with plain classes. These classes still implement `equals` and `hashCode` (thanks to [poko](https://togithub.com/drewhamilton/poko/)), but they no longer offer any `componentN()` or `copy()` functions. Bug fixes - [saket/telephoto#53: Prevent crashes when Compose UI reports the velocity of a gesture to be infinite. - [saket/telephoto#41: Fixed a crash where touch events received after the UI was restored would cause a division by zero error if the layout wasn't measured yet. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ZacSweers/CatchUp). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
I'm trying to overlay the image with an aspect ratio box and I'd like it to follow any zooms & translates the user makes. Unfortunately the accessed zoomFraction includes the initial scale of the image to scale to fit so I don't know what zoom factor to apply to my overlay to match. I think either of the below that would be sufficient:
The text was updated successfully, but these errors were encountered: