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

[Bug]: Drawing while pinch-zooming does not work. #45

Closed
1 task done
vi opened this issue Nov 14, 2021 · 7 comments
Closed
1 task done

[Bug]: Drawing while pinch-zooming does not work. #45

vi opened this issue Nov 14, 2021 · 7 comments
Assignees
Labels
bug Something isn't working confirmed

Comments

@vi
Copy link

vi commented Nov 14, 2021

What happened?

#20 is said to be resolved. Yet it still see it on Android, even with the recent commit:

paint.mp4
  1. Open Butterfly.
  2. Start drawing by touching the screen and moving finger.
  3. Without releasing the finger, also touch second finger to zoom in/out without interrupting the stroke

Expected:

It zooms in/out using first (actively drawing) finger as pivot point if second finger is moved. It scrolls the canvas around if both fingers are moved (such as after finishing the temporary zoom/pan mode it would continue drawing the stroke without any long straight segments).

Actual:

It removes already drawn part, then starts drawing a zigzag line between fingers.

Note:

Filling area between fingers (using a proper closed curve, not a zigzagging line) can be a special, distinct touchscreen-exclusive drawing tool.

Version

build from cebe815, devel branch

Platform

Android

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@vi vi added the bug Something isn't working label Nov 14, 2021
@CodeDoctorDE
Copy link
Member

I think it's a bit complicated to have the first finger as pivot point. Currently I cannot get the first finger so simple. Is it okay, if I disable the drawing when zooming?

@CodeDoctorDE CodeDoctorDE changed the title [Bug]: Drawing while pinch-zooming does not work in Android. [Bug]: Drawing while pinch-zooming does not work. Nov 15, 2021
@CodeDoctorDE
Copy link
Member

Confirmed on all platforms

@vi
Copy link
Author

vi commented Nov 15, 2021

Is it okay, if I disable the drawing when zooming?

My suggested scheme interrupts drawing when zooming, i.e. no new segment should be added to stroke when both fingers are touched down. Or did you mean "disable the zooming when drawing"?

Currently I cannot get the first finger so simple.

Finger, which position on screen is closest to the last remembered position of the lone (pre-zoom) finger should be considered first (and that position coordinates is to be updated each step).
Screen coordinates of that special position would drift when both fingers are down, but scene coordinates of that special position should remain locked.

I think it's a bit complicated to have the first finger as pivot point.

Not doing it (one way or another) would result in unintended stroke segments being added to scene after zooming is done.

What is the complication? Is Flutter not multitouch-ready, so your program receive only partial information about multi-touch events? Or are algorithms and mathematics too complex to implement?

@CodeDoctorDE
Copy link
Member

What is the complication? Is Flutter not multitouch-ready, so your program receive only partial information about multi-touch events? Or are algorithms and mathematics too complex to implement?

I think, currently I only get a pointer if the user moves the pointer. I can google longer, but currently I cannot find a solution which helps me implement this

@CodeDoctorDE
Copy link
Member

@vi
Copy link
Author

vi commented Nov 15, 2021

Even with no special fields, coordinates of all events may be monitored and receiving an event from a touchscreen with substantially different coordinates while having not previously received "up" event from previous location can imply that multi-touch is active and the new event is the second finger.

pointer field is of course helpful, if it works properly. Linked PointerEvent API description suggests that Flutter is multi-touch-ready.

@CodeDoctorDE
Copy link
Member

I will add options how to interact with multiple inputs to customize if you want to use the second input as zooming/moving or as new input to draw

@CodeDoctorDE CodeDoctorDE added help wanted Extra attention is needed and removed help wanted Extra attention is needed labels Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed
Projects
None yet
Development

No branches or pull requests

2 participants