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

Zoom to a rectangle #45

Open
Garito opened this issue May 14, 2024 · 4 comments
Open

Zoom to a rectangle #45

Garito opened this issue May 14, 2024 · 4 comments

Comments

@Garito
Copy link

Garito commented May 14, 2024

Hi
Would be nice to be able to zoom to a rectangle
The code should calculate the ratio and then moveTo + zoomTo

How difficult will it be?

Thanks

@cotton123236
Copy link
Owner

cotton123236 commented Jun 6, 2024

Hey @Garito
Could you please describe it in more detail?
Because in my imagination, this library will only be used for zooming but not for transforming.
Once the element starts out as a rectangle, it will always be a rectangle.

@Garito
Copy link
Author

Garito commented Jun 6, 2024

Sure
I have a list of rectangles that highlight pieces of the image
I would like to allow the user to click on one of the highlights that will result in the image being zoomed to the particular piece of the page that the highlight represents

With the actual code, that would imply to get the x, y of the top left part of the rectangle and the ratio of zoom
Would be nice to get the ratio by passing top, left corner and bottom right corner given the image size

So if the image has 100x100 pixes and the rectangle is 0x100 to 10x100 I would like to zoom to it

Sorry if I explain myself poorly, english is not my main language

@cotton123236
Copy link
Owner

I probably understand what you're talking about.
I can make a example for you, but it will take few days.

@Garito
Copy link
Author

Garito commented Jun 8, 2024

Thanks
If you think that you could do it without modifying the library, perhaps you could explain your idea and avoid the trouble of making the code run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants