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

two finger pan #51

Open
alireza23 opened this issue Apr 26, 2020 · 1 comment
Open

two finger pan #51

alireza23 opened this issue Apr 26, 2020 · 1 comment

Comments

@alireza23
Copy link

alireza23 commented Apr 26, 2020

Hi. I use pinch-zoom around a konvajs canvas. in this canvas the one finger touch is used for drawing and when I zoom the view, drawing and panning has conflict with each other.

<pinch-zoom 
  [disablePan]="togglePan== true? true:false"
  [double-tap]="false"
  style="height: 700px; width: 100%;">
  // konvajs canvas
  <div  id="container"></div>
</pinch-zoom>

can I use two finger touch for panning and one finger for drawing on canvas?
or at least bind disablePan to a property inside parent component "togglePan"? as I did in the code above (that just work for the first time and does not get update when "togglePan" value changes?

@alireza23
Copy link
Author

alireza23 commented Apr 27, 2020

hi again and thanks for your great library.
I disabled panning with this code

<button (click)="togglePan()">toggle panning</button>
<pinch-zoom 
  style="height: 700px; width: 100%; >
  <div 
 (mousemove)="onMouseMove($event)" (touchmove)="onMouseMove($event)"  id="container"></div>
</pinch-zoom>

and in ts file:

disablePan = false;
togglePan() {
   this.disablePan = !this.disablePan;
 }
onMouseMove(event){
  if(!this.disablePan){
   event.stopPropagation();
 }

this works for me, but having two finger panning is a beautiful feature if you could implement in next 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

1 participant