Skip to content

Commit b34ac03

Browse files
chore: adjust pinch start handling
Co-authored-by: siarheihuzarevich <13272876+siarheihuzarevich@users.noreply.github.com>
1 parent 8508d38 commit b34ac03

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

projects/f-flow/src/f-zoom/f-zoom.directive.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ export class FZoomDirective extends FZoomBase implements OnInit, AfterViewInit,
158158
}
159159

160160
private _onTouchStart = (event: TouchEvent) => {
161-
if (event.touches.length !== 2 || this._isLockedContext(event.target)) {
161+
if (event.touches.length !== 2) {
162+
return;
163+
}
164+
165+
if (this._isLockedContext(event.target)) {
162166
this._resetPinch();
163167

164168
return;
@@ -227,7 +231,7 @@ export class FZoomDirective extends FZoomBase implements OnInit, AfterViewInit,
227231
}
228232

229233
private _getTouchDistance(touches: TouchList): number {
230-
if (touches.length < 2) {
234+
if (touches.length !== 2) {
231235
return 0;
232236
}
233237

@@ -241,7 +245,7 @@ export class FZoomDirective extends FZoomBase implements OnInit, AfterViewInit,
241245
}
242246

243247
private _getTouchCenter(touches: TouchList): IPoint {
244-
if (touches.length < 2) {
248+
if (touches.length !== 2) {
245249
return PointExtensions.initialize();
246250
}
247251

0 commit comments

Comments
 (0)