improve:改进多指触摸操作
This commit is contained in:
@@ -323,6 +323,11 @@ namespace Ink_Canvas {
|
||||
}
|
||||
|
||||
private void GridInkCanvasSelectionCover_ManipulationDelta(object sender, ManipulationDeltaEventArgs e) {
|
||||
// 手掌擦时禁止移动/缩放
|
||||
if (isLastTouchEraser || inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint)
|
||||
return;
|
||||
// 三指及以上禁止缩放
|
||||
bool disableScale = dec.Count >= 3;
|
||||
try {
|
||||
if (dec.Count >= 1) {
|
||||
var md = e.DeltaManipulation;
|
||||
@@ -341,7 +346,8 @@ namespace Ink_Canvas {
|
||||
|
||||
// Update matrix to reflect translation/rotation
|
||||
m.Translate(trans.X, trans.Y); // 移动
|
||||
m.ScaleAt(scale.X, scale.Y, center.X, center.Y); // 缩放
|
||||
if (!disableScale)
|
||||
m.ScaleAt(scale.X, scale.Y, center.X, center.Y); // 缩放
|
||||
|
||||
var strokes = inkCanvas.GetSelectedStrokes();
|
||||
if (StrokesSelectionClone.Count != 0)
|
||||
|
||||
@@ -391,6 +391,11 @@ namespace Ink_Canvas {
|
||||
//}
|
||||
|
||||
private void Main_Grid_ManipulationDelta(object sender, ManipulationDeltaEventArgs e) {
|
||||
// 手掌擦时禁止移动/缩放
|
||||
if (isLastTouchEraser || inkCanvas.EditingMode == InkCanvasEditingMode.EraseByPoint)
|
||||
return;
|
||||
// 三指及以上禁止缩放
|
||||
bool disableScale = dec.Count >= 3;
|
||||
if (isInMultiTouchMode || !Settings.Gesture.IsEnableTwoFingerGesture) return;
|
||||
if ((dec.Count >= 2 && (Settings.PowerPointSettings.IsEnableTwoFingerGestureInPresentationMode ||
|
||||
StackPanelPPTControls.Visibility != Visibility.Visible ||
|
||||
@@ -415,7 +420,7 @@ namespace Ink_Canvas {
|
||||
|
||||
if (Settings.Gesture.IsEnableTwoFingerRotation)
|
||||
m.RotateAt(rotate, center.X, center.Y); // 旋转
|
||||
if (Settings.Gesture.IsEnableTwoFingerZoom)
|
||||
if (Settings.Gesture.IsEnableTwoFingerZoom && !disableScale)
|
||||
m.ScaleAt(scale.X, scale.Y, center.X, center.Y); // 缩放
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user