mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-07 20:30:08 +03:00
adjust kScaleSlop
This commit is contained in:
@@ -10,7 +10,8 @@ enum CustomTouchGestureState {
|
||||
twoFingerHorizontalDrag,
|
||||
}
|
||||
|
||||
const kScaleSlop = kPrecisePointerPanSlop / 15;
|
||||
// Adjust Carefully! balance vertical and pan
|
||||
const kScaleSlop = kPrecisePointerPanSlop / 28;
|
||||
|
||||
class CustomTouchGestureRecognizer extends ScaleGestureRecognizer {
|
||||
CustomTouchGestureRecognizer({
|
||||
@@ -154,8 +155,16 @@ class CustomTouchGestureRecognizer extends ScaleGestureRecognizer {
|
||||
_sumScale += d.scale - 1;
|
||||
_sumHorizontal += d.focalPointDelta.dx;
|
||||
_sumVertical += d.focalPointDelta.dy;
|
||||
// start
|
||||
if (onTwoFingerVerticalDragUpdate != null &&
|
||||
// start , order is important
|
||||
if (onTwoFingerScaleUpdate != null && _sumScale.abs() > kScaleSlop) {
|
||||
debugPrint("start Scale");
|
||||
_currentState = CustomTouchGestureState.twoFingerScale;
|
||||
if (onTwoFingerScaleStart != null) {
|
||||
onTwoFingerScaleStart!(ScaleStartDetails(
|
||||
localFocalPoint: d.localFocalPoint, focalPoint: d.focalPoint));
|
||||
}
|
||||
_reset();
|
||||
} else if (onTwoFingerVerticalDragUpdate != null &&
|
||||
_sumVertical.abs() > kPrecisePointerPanSlop &&
|
||||
_sumHorizontal.abs() < kPrecisePointerPanSlop) {
|
||||
debugPrint("start Vertical");
|
||||
@@ -164,14 +173,6 @@ class CustomTouchGestureRecognizer extends ScaleGestureRecognizer {
|
||||
}
|
||||
_currentState = CustomTouchGestureState.twoFingerVerticalDrag;
|
||||
_reset();
|
||||
} else if (onTwoFingerScaleUpdate != null && _sumScale.abs() > kScaleSlop) {
|
||||
debugPrint("start Scale");
|
||||
_currentState = CustomTouchGestureState.twoFingerScale;
|
||||
if (onTwoFingerScaleStart != null) {
|
||||
onTwoFingerScaleStart!(ScaleStartDetails(
|
||||
localFocalPoint: d.localFocalPoint, focalPoint: d.focalPoint));
|
||||
}
|
||||
_reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user