Skip to content

Add ability to specify location to zoom into on the zoom module's in() function #7307

Open
@broox

Description

@broox

Clear and concise description of the problem

Currently, the zoom module's in() function allows a ratio parameter to be passed. It would be nice if we could also specify a position to zoom into. This would allow developers to implement custom functionality to be able to zoom in to a specific point of the image, rather than just the center.

Suggested solution

In the zoom module, add an optional position parameter to the in() function. This parameter could be a set of pixel coordinates on the image to zoom toward.

For example, we could call slider.in(2, [100,100]) to zoom an image by 2x and target the center to be on or around 100px from the left and 100px from the top of the image.

Alternative

No response

Additional context

No response

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Would you like to open a PR for this feature?

  • I'm willing to open a PR

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions