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

[Feature] Add support for Pinch to Zoom #296

Open
2 tasks
brett-estabrook opened this issue Oct 21, 2021 · 4 comments
Open
2 tasks

[Feature] Add support for Pinch to Zoom #296

brett-estabrook opened this issue Oct 21, 2021 · 4 comments

Comments

@brett-estabrook
Copy link
Contributor

brett-estabrook commented Oct 21, 2021

This is a consolidation of these two issues:

However there is a prerequisite issue:

The basic idea is that once we have a clip rect properly in place we can use the Skia Sharp canvas object to Translate and Scale a chart. If this transformations are coordinated with a zoom gesture this will give the look and feel of Pinch Gesture and Zooming.

Scratch Work for Scaling

Scratch Work for Gesture

Once I get a little further along with this I will make a pull request. The above works as a proof of concept in that you can pinch to zoom, however, the labels and Y axis do not properly scale. There's also some pixel precision issues with the clip rect.

Todo Items:

  • Resolve discussion points surrounding clipping on edges of chart
  • Add support for panning while zoomed in.
@brett-estabrook
Copy link
Contributor Author

This is functionally complete. There are however a couple issues that need to be debated. I've posted them in:
#295 (comment)

@brett-estabrook
Copy link
Contributor Author

I have tested this on a number of charts and all seems to work except the issues outlined in my previous comment.

PinchToZoom.mp4

@Seuleuzeuh
Copy link
Contributor

Impressive work ! I need time to look at this

@brett-estabrook
Copy link
Contributor Author

I'm going to make a few changes to this a bit later. I'm going to have an option to turn on/off pinch to zoom and leave it off by default. When its off I will also disable the cliprect. This will allow backwards compatibility by default, and anyone who enables pinch to zoom can also deal with the clipping changes.

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

No branches or pull requests

2 participants