Giter Club home page Giter Club logo

Comments (7)

saket avatar saket commented on May 29, 2024 1

Released as part of 0.7.1.

from telephoto.

saket avatar saket commented on May 29, 2024

A user-zoom factor that goes from 1 when all the way 'zoomed out' to whatever the max zoom is.

ZoomableState maintains this state internally but only exposes the final zoom factor. Will it be sufficient to expose these two values in some fashion?

internal data class ContentZoom(
/**
* The initial scale needed to fit [Modifier.zoomable]'s content with
* respect to [ZoomableState.contentScale].
* */
val baseZoom: ScaleFactor,
/** Zoom applied by user using gestures. */
val userZoom: Float,
) {
fun finalZoom(): ScaleFactor {
return baseZoom * userZoom
}

I'd like it to follow any zooms & translates the user makes.

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.

from telephoto.

evant avatar evant commented on May 29, 2024

Ah yep that should! Reading from userZoom is exactly what I'm looking for.

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.

from telephoto.

saket avatar saket commented on May 29, 2024

Got it. I'll try coming up something. 👍

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.

This screen?

Screenshot_20231110-005843

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

from telephoto.

evant avatar evant commented on May 29, 2024

The first one, note that when you draw on the image it tracks when you zoom/pan around.

from telephoto.

saket avatar saket commented on May 29, 2024

Gotcha!

from telephoto.

saket avatar saket commented on May 29, 2024

@evant Wanna try out 0.7.0-SNAPSHOT to see if you're able to use this?

interface ScaleMetadata {
/**
* The default scale needed to position the content within its layout bounds with
* respect to [ZoomableState.contentScale].
*/
val initialScale: ScaleFactor
/**
* Scale applied by the user using zoom gestures. The final scale of the content
* is calculated using [initialScale] x [userZoom].
*/
val userZoom: Float
}

from telephoto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.