[merge] 合并Raspberry-Monster的 “修改撤回行为”
-------- Co-authored-by: Raspberry-Monster <lele2194512339@outlook.com>
This commit is contained in:
parent
3e0f8ab61d
commit
72f703ea0c
@ -1,5 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Windows.Ink;
|
using System.Windows.Ink;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace Ink_Canvas.Helpers
|
namespace Ink_Canvas.Helpers
|
||||||
{
|
{
|
||||||
@ -42,16 +43,16 @@ namespace Ink_Canvas.Helpers
|
|||||||
NotifyUndoRedoState();
|
NotifyUndoRedoState();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CommitStrokeManipulationHistory(StrokeCollection strokeToBeReplaced, StrokeCollection generatedStroke)
|
public void CommitStrokeManipulationHistory(StrokeCollection manipulatedStrokes, Matrix matrix)
|
||||||
{
|
{
|
||||||
if (_currentIndex + 1 < _currentStrokeHistory.Count)
|
if (_currentIndex + 1 < _currentStrokeHistory.Count)
|
||||||
{
|
{
|
||||||
_currentStrokeHistory.RemoveRange(_currentIndex + 1, (_currentStrokeHistory.Count - 1) - _currentIndex);
|
_currentStrokeHistory.RemoveRange(_currentIndex + 1, (_currentStrokeHistory.Count - 1) - _currentIndex);
|
||||||
}
|
}
|
||||||
_currentStrokeHistory.Add(new TimeMachineHistory(generatedStroke,
|
_currentStrokeHistory.Add(
|
||||||
TimeMachineHistoryType.Manipulation,
|
new TimeMachineHistory(manipulatedStrokes,
|
||||||
false,
|
TimeMachineHistoryType.Manipulation,
|
||||||
strokeToBeReplaced));
|
matrix));
|
||||||
_currentIndex = _currentStrokeHistory.Count - 1;
|
_currentIndex = _currentStrokeHistory.Count - 1;
|
||||||
NotifyUndoRedoState();
|
NotifyUndoRedoState();
|
||||||
}
|
}
|
||||||
@ -122,6 +123,7 @@ namespace Ink_Canvas.Helpers
|
|||||||
public bool StrokeHasBeenCleared;
|
public bool StrokeHasBeenCleared;
|
||||||
public StrokeCollection CurrentStroke;
|
public StrokeCollection CurrentStroke;
|
||||||
public StrokeCollection ReplacedStroke;
|
public StrokeCollection ReplacedStroke;
|
||||||
|
public Matrix ManipulationHistory;
|
||||||
public TimeMachineHistory(StrokeCollection currentStroke, TimeMachineHistoryType commitType, bool strokeHasBeenCleared)
|
public TimeMachineHistory(StrokeCollection currentStroke, TimeMachineHistoryType commitType, bool strokeHasBeenCleared)
|
||||||
{
|
{
|
||||||
CommitType = commitType;
|
CommitType = commitType;
|
||||||
@ -129,6 +131,12 @@ namespace Ink_Canvas.Helpers
|
|||||||
StrokeHasBeenCleared = strokeHasBeenCleared;
|
StrokeHasBeenCleared = strokeHasBeenCleared;
|
||||||
ReplacedStroke = null;
|
ReplacedStroke = null;
|
||||||
}
|
}
|
||||||
|
public TimeMachineHistory(StrokeCollection currentStroke, TimeMachineHistoryType commitType, Matrix matrix)
|
||||||
|
{
|
||||||
|
CommitType = commitType;
|
||||||
|
CurrentStroke = currentStroke;
|
||||||
|
ManipulationHistory = matrix;
|
||||||
|
}
|
||||||
public TimeMachineHistory(StrokeCollection currentStroke, TimeMachineHistoryType commitType, bool strokeHasBeenCleared, StrokeCollection replacedStroke)
|
public TimeMachineHistory(StrokeCollection currentStroke, TimeMachineHistoryType commitType, bool strokeHasBeenCleared, StrokeCollection replacedStroke)
|
||||||
{
|
{
|
||||||
CommitType = commitType;
|
CommitType = commitType;
|
||||||
|
@ -1241,7 +1241,6 @@
|
|||||||
MouseMove="inkCanvas_MouseMove"
|
MouseMove="inkCanvas_MouseMove"
|
||||||
MouseUp="inkCanvas_MouseUp"
|
MouseUp="inkCanvas_MouseUp"
|
||||||
ManipulationStarting="inkCanvas_ManipulationStarting"
|
ManipulationStarting="inkCanvas_ManipulationStarting"
|
||||||
ManipulationStarted="inkCanvas_ManipulationStarted"
|
|
||||||
SelectionChanged="inkCanvas_SelectionChanged"
|
SelectionChanged="inkCanvas_SelectionChanged"
|
||||||
StrokeCollected="inkCanvas_StrokeCollected" ClipToBounds="False" Background="Transparent" />
|
StrokeCollected="inkCanvas_StrokeCollected" ClipToBounds="False" Background="Transparent" />
|
||||||
<InkCanvas x:Name="FakeInkCanvas" Background="Transparent" IsHitTestVisible="False" Visibility="Hidden"
|
<InkCanvas x:Name="FakeInkCanvas" Background="Transparent" IsHitTestVisible="False" Visibility="Hidden"
|
||||||
|
@ -42,176 +42,14 @@ namespace Ink_Canvas {
|
|||||||
_currentCommitType = CommitReason.CodeInput;
|
_currentCommitType = CommitReason.CodeInput;
|
||||||
timeMachine.ImportTimeMachineHistory(TimeMachineHistories[0]);
|
timeMachine.ImportTimeMachineHistory(TimeMachineHistories[0]);
|
||||||
foreach (var item in TimeMachineHistories[0]) {
|
foreach (var item in TimeMachineHistories[0]) {
|
||||||
if (item.CommitType == TimeMachineHistoryType.UserInput) {
|
ApplyHistoryToCanvas(item);
|
||||||
if (!item.StrokeHasBeenCleared) {
|
|
||||||
foreach (var strokes in item.CurrentStroke) {
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
foreach (var strokes in item.CurrentStroke) {
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (item.CommitType == TimeMachineHistoryType.ShapeRecognition) {
|
|
||||||
if (item.StrokeHasBeenCleared) {
|
|
||||||
|
|
||||||
foreach (var strokes in item.CurrentStroke) {
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke) {
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
foreach (var strokes in item.CurrentStroke) {
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke) {
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (item.CommitType == TimeMachineHistoryType.Manipulation) {
|
|
||||||
if (item.StrokeHasBeenCleared) {
|
|
||||||
|
|
||||||
foreach (var strokes in item.CurrentStroke) {
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke) {
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
foreach (var strokes in item.CurrentStroke) {
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke) {
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (item.CommitType == TimeMachineHistoryType.Clear) {
|
|
||||||
if (!item.StrokeHasBeenCleared) {
|
|
||||||
if (item.CurrentStroke != null) {
|
|
||||||
foreach (var currentStroke in item.CurrentStroke) {
|
|
||||||
if (!inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Add(currentStroke);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (item.ReplacedStroke != null) {
|
|
||||||
foreach (var replacedStroke in item.ReplacedStroke) {
|
|
||||||
if (inkCanvas.Strokes.Contains(replacedStroke)) inkCanvas.Strokes.Remove(replacedStroke);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (item.ReplacedStroke != null) {
|
|
||||||
foreach (var replacedStroke in item.ReplacedStroke) {
|
|
||||||
if (!inkCanvas.Strokes.Contains(replacedStroke)) inkCanvas.Strokes.Add(replacedStroke);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (item.CurrentStroke != null) {
|
|
||||||
foreach (var currentStroke in item.CurrentStroke) {
|
|
||||||
if (inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Remove(currentStroke);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_currentCommitType = CommitReason.UserInput;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_currentCommitType = CommitReason.CodeInput;
|
_currentCommitType = CommitReason.CodeInput;
|
||||||
timeMachine.ImportTimeMachineHistory(TimeMachineHistories[CurrentWhiteboardIndex]);
|
timeMachine.ImportTimeMachineHistory(TimeMachineHistories[CurrentWhiteboardIndex]);
|
||||||
foreach (var item in TimeMachineHistories[CurrentWhiteboardIndex]) {
|
foreach (var item in TimeMachineHistories[CurrentWhiteboardIndex]) {
|
||||||
if (item.CommitType == TimeMachineHistoryType.UserInput) {
|
ApplyHistoryToCanvas(item);
|
||||||
if (!item.StrokeHasBeenCleared) {
|
|
||||||
foreach (var strokes in item.CurrentStroke) {
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
foreach (var strokes in item.CurrentStroke) {
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (item.CommitType == TimeMachineHistoryType.ShapeRecognition) {
|
|
||||||
if (item.StrokeHasBeenCleared) {
|
|
||||||
|
|
||||||
foreach (var strokes in item.CurrentStroke) {
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke) {
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
foreach (var strokes in item.CurrentStroke) {
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke) {
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (item.CommitType == TimeMachineHistoryType.Manipulation) {
|
|
||||||
if (item.StrokeHasBeenCleared) {
|
|
||||||
|
|
||||||
foreach (var strokes in item.CurrentStroke) {
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke) {
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
foreach (var strokes in item.CurrentStroke) {
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke) {
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (item.CommitType == TimeMachineHistoryType.Clear) {
|
|
||||||
if (!item.StrokeHasBeenCleared) {
|
|
||||||
if (item.CurrentStroke != null) {
|
|
||||||
foreach (var currentStroke in item.CurrentStroke) {
|
|
||||||
if (!inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Add(currentStroke);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (item.ReplacedStroke != null) {
|
|
||||||
foreach (var replacedStroke in item.ReplacedStroke) {
|
|
||||||
if (inkCanvas.Strokes.Contains(replacedStroke)) inkCanvas.Strokes.Remove(replacedStroke);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (item.ReplacedStroke != null) {
|
|
||||||
foreach (var replacedStroke in item.ReplacedStroke) {
|
|
||||||
if (!inkCanvas.Strokes.Contains(replacedStroke)) inkCanvas.Strokes.Add(replacedStroke);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (item.CurrentStroke != null) {
|
|
||||||
foreach (var currentStroke in item.CurrentStroke) {
|
|
||||||
if (inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Remove(currentStroke);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_currentCommitType = CommitReason.UserInput;
|
|
||||||
}
|
}
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
@ -1152,127 +1152,8 @@ namespace Ink_Canvas
|
|||||||
GridInkCanvasSelectionCover.Visibility = Visibility.Collapsed;
|
GridInkCanvasSelectionCover.Visibility = Visibility.Collapsed;
|
||||||
inkCanvas.Select(new StrokeCollection());
|
inkCanvas.Select(new StrokeCollection());
|
||||||
}
|
}
|
||||||
_currentCommitType = CommitReason.CodeInput;
|
|
||||||
var item = timeMachine.Undo();
|
var item = timeMachine.Undo();
|
||||||
if (item.CommitType == TimeMachineHistoryType.UserInput)
|
ApplyHistoryToCanvas(item);
|
||||||
{
|
|
||||||
if (!item.StrokeHasBeenCleared)
|
|
||||||
{
|
|
||||||
foreach (var strokes in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var strokes in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (item.CommitType == TimeMachineHistoryType.ShapeRecognition)
|
|
||||||
{
|
|
||||||
if (item.StrokeHasBeenCleared)
|
|
||||||
{
|
|
||||||
|
|
||||||
foreach (var strokes in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke)
|
|
||||||
{
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var strokes in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke)
|
|
||||||
{
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (item.CommitType == TimeMachineHistoryType.Manipulation)
|
|
||||||
{
|
|
||||||
if (item.StrokeHasBeenCleared)
|
|
||||||
{
|
|
||||||
|
|
||||||
foreach (var strokes in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke)
|
|
||||||
{
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var strokes in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke)
|
|
||||||
{
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (item.CommitType == TimeMachineHistoryType.Clear)
|
|
||||||
{
|
|
||||||
if (!item.StrokeHasBeenCleared)
|
|
||||||
{
|
|
||||||
if (item.CurrentStroke != null)
|
|
||||||
{
|
|
||||||
foreach (var currentStroke in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (!inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Add(currentStroke);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (item.ReplacedStroke != null)
|
|
||||||
{
|
|
||||||
foreach (var replacedStroke in item.ReplacedStroke)
|
|
||||||
{
|
|
||||||
if (inkCanvas.Strokes.Contains(replacedStroke)) inkCanvas.Strokes.Remove(replacedStroke);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (item.ReplacedStroke != null)
|
|
||||||
{
|
|
||||||
foreach (var replacedStroke in item.ReplacedStroke)
|
|
||||||
{
|
|
||||||
if (!inkCanvas.Strokes.Contains(replacedStroke)) inkCanvas.Strokes.Add(replacedStroke);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (item.CurrentStroke != null)
|
|
||||||
{
|
|
||||||
foreach (var currentStroke in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Remove(currentStroke);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_currentCommitType = CommitReason.UserInput;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BtnRedo_Click(object sender, RoutedEventArgs e)
|
private void BtnRedo_Click(object sender, RoutedEventArgs e)
|
||||||
@ -1282,128 +1163,8 @@ namespace Ink_Canvas
|
|||||||
GridInkCanvasSelectionCover.Visibility = Visibility.Collapsed;
|
GridInkCanvasSelectionCover.Visibility = Visibility.Collapsed;
|
||||||
inkCanvas.Select(new StrokeCollection());
|
inkCanvas.Select(new StrokeCollection());
|
||||||
}
|
}
|
||||||
|
|
||||||
_currentCommitType = CommitReason.CodeInput;
|
|
||||||
var item = timeMachine.Redo();
|
var item = timeMachine.Redo();
|
||||||
if (item.CommitType == TimeMachineHistoryType.UserInput)
|
ApplyHistoryToCanvas(item);
|
||||||
{
|
|
||||||
if (!item.StrokeHasBeenCleared)
|
|
||||||
{
|
|
||||||
foreach (var strokes in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var strokes in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (item.CommitType == TimeMachineHistoryType.ShapeRecognition)
|
|
||||||
{
|
|
||||||
if (item.StrokeHasBeenCleared)
|
|
||||||
{
|
|
||||||
|
|
||||||
foreach (var strokes in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke)
|
|
||||||
{
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var strokes in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke)
|
|
||||||
{
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (item.CommitType == TimeMachineHistoryType.Manipulation)
|
|
||||||
{
|
|
||||||
if (item.StrokeHasBeenCleared)
|
|
||||||
{
|
|
||||||
|
|
||||||
foreach (var strokes in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke)
|
|
||||||
{
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (var strokes in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (!inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Add(strokes);
|
|
||||||
}
|
|
||||||
foreach (var strokes in item.ReplacedStroke)
|
|
||||||
{
|
|
||||||
if (inkCanvas.Strokes.Contains(strokes))
|
|
||||||
inkCanvas.Strokes.Remove(strokes);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (item.CommitType == TimeMachineHistoryType.Clear)
|
|
||||||
{
|
|
||||||
if (!item.StrokeHasBeenCleared)
|
|
||||||
{
|
|
||||||
if (item.CurrentStroke != null)
|
|
||||||
{
|
|
||||||
foreach (var currentStroke in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (!inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Add(currentStroke);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (item.ReplacedStroke != null)
|
|
||||||
{
|
|
||||||
foreach (var replacedStroke in item.ReplacedStroke)
|
|
||||||
{
|
|
||||||
if (inkCanvas.Strokes.Contains(replacedStroke)) inkCanvas.Strokes.Remove(replacedStroke);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (item.ReplacedStroke != null)
|
|
||||||
{
|
|
||||||
foreach (var replacedStroke in item.ReplacedStroke)
|
|
||||||
{
|
|
||||||
if (!inkCanvas.Strokes.Contains(replacedStroke)) inkCanvas.Strokes.Add(replacedStroke);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (item.CurrentStroke != null)
|
|
||||||
{
|
|
||||||
foreach (var currentStroke in item.CurrentStroke)
|
|
||||||
{
|
|
||||||
if (inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Remove(currentStroke);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_currentCommitType = CommitReason.UserInput;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Btn_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
|
private void Btn_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||||
|
@ -19,14 +19,18 @@ namespace Ink_Canvas {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool isStrokeSelectionCloneOn = false;
|
bool isStrokeSelectionCloneOn = false;
|
||||||
private void BorderStrokeSelectionClone_MouseUp(object sender, MouseButtonEventArgs e) {
|
private void BorderStrokeSelectionClone_MouseUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
if (lastBorderMouseDownObject != sender) return;
|
if (lastBorderMouseDownObject != sender) return;
|
||||||
|
|
||||||
if (isStrokeSelectionCloneOn) {
|
if (isStrokeSelectionCloneOn)
|
||||||
|
{
|
||||||
BorderStrokeSelectionClone.Background = Brushes.Transparent;
|
BorderStrokeSelectionClone.Background = Brushes.Transparent;
|
||||||
|
|
||||||
isStrokeSelectionCloneOn = false;
|
isStrokeSelectionCloneOn = false;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
BorderStrokeSelectionClone.Background = new SolidColorBrush(StringToColor("#FF1ED760"));
|
BorderStrokeSelectionClone.Background = new SolidColorBrush(StringToColor("#FF1ED760"));
|
||||||
|
|
||||||
isStrokeSelectionCloneOn = true;
|
isStrokeSelectionCloneOn = true;
|
||||||
@ -96,15 +100,10 @@ namespace Ink_Canvas {
|
|||||||
|
|
||||||
StrokeCollection targetStrokes = inkCanvas.GetSelectedStrokes();
|
StrokeCollection targetStrokes = inkCanvas.GetSelectedStrokes();
|
||||||
StrokeCollection resultStrokes = targetStrokes.Clone();
|
StrokeCollection resultStrokes = targetStrokes.Clone();
|
||||||
foreach (Stroke stroke in resultStrokes) {
|
foreach (Stroke stroke in targetStrokes) {
|
||||||
stroke.Transform(m, false);
|
stroke.Transform(m, false);
|
||||||
}
|
}
|
||||||
_currentCommitType = CommitReason.Manipulation;
|
timeMachine.CommitStrokeManipulationHistory(targetStrokes, m);
|
||||||
inkCanvas.Strokes.Replace(targetStrokes, resultStrokes);
|
|
||||||
_currentCommitType = CommitReason.UserInput;
|
|
||||||
isProgramChangeStrokeSelection = true;
|
|
||||||
inkCanvas.Select(resultStrokes);
|
|
||||||
isProgramChangeStrokeSelection = false;
|
|
||||||
|
|
||||||
//updateBorderStrokeSelectionControlLocation();
|
//updateBorderStrokeSelectionControlLocation();
|
||||||
}
|
}
|
||||||
@ -126,15 +125,11 @@ namespace Ink_Canvas {
|
|||||||
|
|
||||||
StrokeCollection targetStrokes = inkCanvas.GetSelectedStrokes();
|
StrokeCollection targetStrokes = inkCanvas.GetSelectedStrokes();
|
||||||
StrokeCollection resultStrokes = targetStrokes.Clone();
|
StrokeCollection resultStrokes = targetStrokes.Clone();
|
||||||
foreach (Stroke stroke in resultStrokes) {
|
foreach (Stroke stroke in targetStrokes) {
|
||||||
stroke.Transform(m, false);
|
stroke.Transform(m, false);
|
||||||
}
|
}
|
||||||
_currentCommitType = CommitReason.Manipulation;
|
timeMachine.CommitStrokeManipulationHistory(targetStrokes, m);
|
||||||
inkCanvas.Strokes.Replace(targetStrokes, resultStrokes);
|
|
||||||
_currentCommitType = CommitReason.UserInput;
|
|
||||||
isProgramChangeStrokeSelection = true;
|
|
||||||
inkCanvas.Select(resultStrokes);
|
|
||||||
isProgramChangeStrokeSelection = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ImageRotate45_MouseUp(object sender, MouseButtonEventArgs e) {
|
private void ImageRotate45_MouseUp(object sender, MouseButtonEventArgs e) {
|
||||||
@ -154,15 +149,10 @@ namespace Ink_Canvas {
|
|||||||
|
|
||||||
StrokeCollection targetStrokes = inkCanvas.GetSelectedStrokes();
|
StrokeCollection targetStrokes = inkCanvas.GetSelectedStrokes();
|
||||||
StrokeCollection resultStrokes = targetStrokes.Clone();
|
StrokeCollection resultStrokes = targetStrokes.Clone();
|
||||||
foreach (Stroke stroke in resultStrokes) {
|
foreach (Stroke stroke in targetStrokes) {
|
||||||
stroke.Transform(m, false);
|
stroke.Transform(m, false);
|
||||||
}
|
}
|
||||||
_currentCommitType = CommitReason.Manipulation;
|
timeMachine.CommitStrokeManipulationHistory(targetStrokes, m);
|
||||||
inkCanvas.Strokes.Replace(targetStrokes, resultStrokes);
|
|
||||||
_currentCommitType = CommitReason.UserInput;
|
|
||||||
isProgramChangeStrokeSelection = true;
|
|
||||||
inkCanvas.Select(resultStrokes);
|
|
||||||
isProgramChangeStrokeSelection = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ImageRotate90_MouseUp(object sender, MouseButtonEventArgs e) {
|
private void ImageRotate90_MouseUp(object sender, MouseButtonEventArgs e) {
|
||||||
@ -182,15 +172,10 @@ namespace Ink_Canvas {
|
|||||||
|
|
||||||
StrokeCollection targetStrokes = inkCanvas.GetSelectedStrokes();
|
StrokeCollection targetStrokes = inkCanvas.GetSelectedStrokes();
|
||||||
StrokeCollection resultStrokes = targetStrokes.Clone();
|
StrokeCollection resultStrokes = targetStrokes.Clone();
|
||||||
foreach (Stroke stroke in resultStrokes) {
|
foreach (Stroke stroke in targetStrokes) {
|
||||||
stroke.Transform(m, false);
|
stroke.Transform(m, false);
|
||||||
}
|
}
|
||||||
_currentCommitType = CommitReason.Manipulation;
|
timeMachine.CommitStrokeManipulationHistory(targetStrokes, m);
|
||||||
inkCanvas.Strokes.Replace(targetStrokes, resultStrokes);
|
|
||||||
_currentCommitType = CommitReason.UserInput;
|
|
||||||
isProgramChangeStrokeSelection = true;
|
|
||||||
inkCanvas.Select(resultStrokes);
|
|
||||||
isProgramChangeStrokeSelection = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -302,6 +287,15 @@ namespace Ink_Canvas {
|
|||||||
stroke.DrawingAttributes.Height *= md.Scale.Y;
|
stroke.DrawingAttributes.Height *= md.Scale.Y;
|
||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
if (lastTempManiputlaionMatrix == null)
|
||||||
|
{
|
||||||
|
lastTempManiputlaionMatrix = m;
|
||||||
|
lastTempStrokeCollection = strokes;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lastTempManiputlaionMatrix?.Append(m);
|
||||||
|
}
|
||||||
|
|
||||||
updateBorderStrokeSelectionControlLocation();
|
updateBorderStrokeSelectionControlLocation();
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ using System.Windows;
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Ink;
|
using System.Windows.Ink;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using MessageBox = System.Windows.MessageBox;
|
using MessageBox = System.Windows.MessageBox;
|
||||||
using Point = System.Windows.Point;
|
using Point = System.Windows.Point;
|
||||||
@ -1151,6 +1152,8 @@ namespace Ink_Canvas {
|
|||||||
}
|
}
|
||||||
Stroke lastTempStroke = null;
|
Stroke lastTempStroke = null;
|
||||||
StrokeCollection lastTempStrokeCollection = new StrokeCollection();
|
StrokeCollection lastTempStrokeCollection = new StrokeCollection();
|
||||||
|
Matrix? lastTempManiputlaionMatrix = null;
|
||||||
|
|
||||||
bool isWaitUntilNextTouchDown = false;
|
bool isWaitUntilNextTouchDown = false;
|
||||||
private List<System.Windows.Point> GenerateEllipseGeometry(System.Windows.Point st, System.Windows.Point ed, bool isDrawTop = true, bool isDrawBottom = true) {
|
private List<System.Windows.Point> GenerateEllipseGeometry(System.Windows.Point st, System.Windows.Point ed, bool isDrawTop = true, bool isDrawBottom = true) {
|
||||||
double a = 0.5 * (ed.X - st.X);
|
double a = 0.5 * (ed.X - st.X);
|
||||||
@ -1430,8 +1433,15 @@ namespace Ink_Canvas {
|
|||||||
timeMachine.CommitStrokeUserInputHistory(collection);
|
timeMachine.CommitStrokeUserInputHistory(collection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (lastTempManiputlaionMatrix != null)
|
||||||
|
{
|
||||||
|
timeMachine.CommitStrokeManipulationHistory(lastTempStrokeCollection, lastTempManiputlaionMatrix.Value);
|
||||||
|
lastTempStrokeCollection = null;
|
||||||
|
lastTempManiputlaionMatrix = null;
|
||||||
|
}
|
||||||
lastTempStroke = null;
|
lastTempStroke = null;
|
||||||
lastTempStrokeCollection = null;
|
lastTempStrokeCollection = null;
|
||||||
|
lastTempManiputlaionMatrix = null;
|
||||||
if (Settings.Canvas.FitToCurve == true)
|
if (Settings.Canvas.FitToCurve == true)
|
||||||
{
|
{
|
||||||
drawingAttributes.FitToCurve = true;
|
drawingAttributes.FitToCurve = true;
|
||||||
|
@ -21,6 +21,84 @@ namespace Ink_Canvas {
|
|||||||
private StrokeCollection CuboidStrokeCollection;
|
private StrokeCollection CuboidStrokeCollection;
|
||||||
private TimeMachine timeMachine = new TimeMachine();
|
private TimeMachine timeMachine = new TimeMachine();
|
||||||
|
|
||||||
|
private void ApplyHistoryToCanvas(TimeMachineHistory item) {
|
||||||
|
_currentCommitType = CommitReason.CodeInput;
|
||||||
|
if (item.CommitType == TimeMachineHistoryType.UserInput) {
|
||||||
|
if (!item.StrokeHasBeenCleared) {
|
||||||
|
foreach (var strokes in item.CurrentStroke) {
|
||||||
|
if (!inkCanvas.Strokes.Contains(strokes))
|
||||||
|
inkCanvas.Strokes.Add(strokes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
foreach (var strokes in item.CurrentStroke) {
|
||||||
|
if (inkCanvas.Strokes.Contains(strokes))
|
||||||
|
inkCanvas.Strokes.Remove(strokes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (item.CommitType == TimeMachineHistoryType.ShapeRecognition) {
|
||||||
|
if (item.StrokeHasBeenCleared) {
|
||||||
|
foreach (var strokes in item.CurrentStroke) {
|
||||||
|
if (inkCanvas.Strokes.Contains(strokes))
|
||||||
|
inkCanvas.Strokes.Remove(strokes);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var strokes in item.ReplacedStroke) {
|
||||||
|
if (!inkCanvas.Strokes.Contains(strokes))
|
||||||
|
inkCanvas.Strokes.Add(strokes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
foreach (var strokes in item.CurrentStroke) {
|
||||||
|
if (!inkCanvas.Strokes.Contains(strokes))
|
||||||
|
inkCanvas.Strokes.Add(strokes);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var strokes in item.ReplacedStroke) {
|
||||||
|
if (inkCanvas.Strokes.Contains(strokes))
|
||||||
|
inkCanvas.Strokes.Remove(strokes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (item.CommitType == TimeMachineHistoryType.Manipulation) {
|
||||||
|
item.ManipulationHistory.Invert();
|
||||||
|
foreach (var strokes in item.CurrentStroke) {
|
||||||
|
strokes.Transform(item.ManipulationHistory, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (item.CommitType == TimeMachineHistoryType.Clear) {
|
||||||
|
if (!item.StrokeHasBeenCleared) {
|
||||||
|
if (item.CurrentStroke != null) {
|
||||||
|
foreach (var currentStroke in item.CurrentStroke) {
|
||||||
|
if (!inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Add(currentStroke);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.ReplacedStroke != null) {
|
||||||
|
foreach (var replacedStroke in item.ReplacedStroke) {
|
||||||
|
if (inkCanvas.Strokes.Contains(replacedStroke)) inkCanvas.Strokes.Remove(replacedStroke);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (item.ReplacedStroke != null) {
|
||||||
|
foreach (var replacedStroke in item.ReplacedStroke) {
|
||||||
|
if (!inkCanvas.Strokes.Contains(replacedStroke)) inkCanvas.Strokes.Add(replacedStroke);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.CurrentStroke != null) {
|
||||||
|
foreach (var currentStroke in item.CurrentStroke) {
|
||||||
|
if (inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Remove(currentStroke);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_currentCommitType = CommitReason.UserInput;
|
||||||
|
}
|
||||||
|
|
||||||
private void TimeMachine_OnUndoStateChanged(bool status) {
|
private void TimeMachine_OnUndoStateChanged(bool status) {
|
||||||
var result = status ? Visibility.Visible : Visibility.Collapsed;
|
var result = status ? Visibility.Visible : Visibility.Collapsed;
|
||||||
BtnUndo.Visibility = result;
|
BtnUndo.Visibility = result;
|
||||||
@ -40,11 +118,7 @@ namespace Ink_Canvas {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_currentCommitType == CommitReason.CodeInput || _currentCommitType == CommitReason.ShapeDrawing) return;
|
if (_currentCommitType == CommitReason.CodeInput || _currentCommitType == CommitReason.ShapeDrawing) return;
|
||||||
if (_currentCommitType == CommitReason.Manipulation)
|
|
||||||
{
|
|
||||||
timeMachine.CommitStrokeManipulationHistory(e.Removed, e.Added);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ((e.Added.Count != 0 || e.Removed.Count != 0) && IsEraseByPoint) {
|
if ((e.Added.Count != 0 || e.Removed.Count != 0) && IsEraseByPoint) {
|
||||||
if (AddedStroke == null) AddedStroke = new StrokeCollection();
|
if (AddedStroke == null) AddedStroke = new StrokeCollection();
|
||||||
if (ReplacedStroke == null) ReplacedStroke = new StrokeCollection();
|
if (ReplacedStroke == null) ReplacedStroke = new StrokeCollection();
|
||||||
@ -52,12 +126,14 @@ namespace Ink_Canvas {
|
|||||||
ReplacedStroke.Add(e.Removed);
|
ReplacedStroke.Add(e.Removed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.Added.Count != 0) {
|
if (e.Added.Count != 0) {
|
||||||
if (_currentCommitType == CommitReason.ShapeRecognition) {
|
if (_currentCommitType == CommitReason.ShapeRecognition) {
|
||||||
timeMachine.CommitStrokeShapeHistory(ReplacedStroke, e.Added);
|
timeMachine.CommitStrokeShapeHistory(ReplacedStroke, e.Added);
|
||||||
ReplacedStroke = null;
|
ReplacedStroke = null;
|
||||||
return;
|
return;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
timeMachine.CommitStrokeUserInputHistory(e.Added);
|
timeMachine.CommitStrokeUserInputHistory(e.Added);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -67,7 +143,8 @@ namespace Ink_Canvas {
|
|||||||
if (_currentCommitType == CommitReason.ShapeRecognition) {
|
if (_currentCommitType == CommitReason.ShapeRecognition) {
|
||||||
ReplacedStroke = e.Removed;
|
ReplacedStroke = e.Removed;
|
||||||
return;
|
return;
|
||||||
} else if (!IsEraseByPoint || _currentCommitType == CommitReason.ClearingCanvas) {
|
}
|
||||||
|
else if (!IsEraseByPoint || _currentCommitType == CommitReason.ClearingCanvas) {
|
||||||
timeMachine.CommitStrokeEraseHistory(e.Removed);
|
timeMachine.CommitStrokeEraseHistory(e.Removed);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -358,23 +358,25 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void inkCanvas_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
|
// -- removed --
|
||||||
{
|
//
|
||||||
if (isInMultiTouchMode || !Settings.Gesture.IsEnableTwoFingerGesture || inkCanvas.Strokes.Count == 0 || dec.Count() < 2) return;
|
//private void inkCanvas_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
|
||||||
_currentCommitType = CommitReason.Manipulation;
|
//{
|
||||||
StrokeCollection strokes = inkCanvas.GetSelectedStrokes();
|
// if (isInMultiTouchMode || !Settings.Gesture.IsEnableTwoFingerGesture || inkCanvas.Strokes.Count == 0 || dec.Count() < 2) return;
|
||||||
if (strokes.Count != 0)
|
// _currentCommitType = CommitReason.Manipulation;
|
||||||
{
|
// StrokeCollection strokes = inkCanvas.GetSelectedStrokes();
|
||||||
inkCanvas.Strokes.Replace(strokes, strokes.Clone());
|
// if (strokes.Count != 0)
|
||||||
}
|
// {
|
||||||
else
|
// inkCanvas.Strokes.Replace(strokes, strokes.Clone());
|
||||||
{
|
// }
|
||||||
var originalStrokes = inkCanvas.Strokes;
|
// else
|
||||||
var targetStrokes = originalStrokes.Clone();
|
// {
|
||||||
originalStrokes.Replace(originalStrokes, targetStrokes);
|
// var originalStrokes = inkCanvas.Strokes;
|
||||||
}
|
// var targetStrokes = originalStrokes.Clone();
|
||||||
_currentCommitType = CommitReason.UserInput;
|
// originalStrokes.Replace(originalStrokes, targetStrokes);
|
||||||
}
|
// }
|
||||||
|
// _currentCommitType = CommitReason.UserInput;
|
||||||
|
//}
|
||||||
|
|
||||||
private void Main_Grid_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
|
private void Main_Grid_ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
|
||||||
{
|
{
|
||||||
@ -433,6 +435,15 @@ namespace Ink_Canvas
|
|||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (lastTempManiputlaionMatrix == null)
|
||||||
|
{
|
||||||
|
lastTempManiputlaionMatrix = m;
|
||||||
|
lastTempStrokeCollection = strokes;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lastTempManiputlaionMatrix?.Append(m);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -465,6 +476,15 @@ namespace Ink_Canvas
|
|||||||
(circle.Stroke.StylusPoints[0].Y + circle.Stroke.StylusPoints[circle.Stroke.StylusPoints.Count / 2].Y) / 2
|
(circle.Stroke.StylusPoints[0].Y + circle.Stroke.StylusPoints[circle.Stroke.StylusPoints.Count / 2].Y) / 2
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
if (lastTempManiputlaionMatrix == null)
|
||||||
|
{
|
||||||
|
lastTempManiputlaionMatrix = m;
|
||||||
|
lastTempStrokeCollection = inkCanvas.Strokes;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lastTempManiputlaionMatrix?.Append(m);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user