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

Scaling mode is not preventing draw mode #7

Closed
ynnob opened this issue May 19, 2021 · 1 comment
Closed

Scaling mode is not preventing draw mode #7

ynnob opened this issue May 19, 2021 · 1 comment

Comments

@ynnob
Copy link

ynnob commented May 19, 2021

Problem

If the mode scalable is set to true the ImagePainter does not prevent painting while scaling.
Also this mode should be called zoom instead of scaling because the scaling of the image is not saved.

Solution

Implement a Listener wrapped around the canvas that handles the current FingerCount:

[...] Listener(
      onPointerDown: (_) => increaseFingerCount(),
      onPointerUp: (_) => decreaseFingerCount(),
      child: [...]

Then cancel painting when the fingerCount is == 2

if (_fingerCount == 2) {
   return;
}
@lively-bigyan
Copy link
Collaborator

Thank you for opening up the issue. The implementation was done on the previous versions of app but It felt kind of redundant to do this because painting begins when user starts touching. Although it did prevent further painting while zooming, it didn't do much for the initially painted ones so it was removed for latest versions during refactors. It will be included in future versions of the package. For the mode, I think your suggestion makes sense. I'll make sure to include that in upcoming versions.

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