Skip to content

Commit

Permalink
[fix] CommitStrokeManipulationHistory in TimeMachine
Browse files Browse the repository at this point in the history
  • Loading branch information
ChangSakura committed Aug 9, 2024
1 parent dc4248e commit 4f2f4bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Ink Canvas/MainWindow_cs/MW_SelectionGestures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,18 @@ private void MatrixTransform(int type)
break;
}

StrokeCollection targetStrokes = inkCanvas.GetSelectedStrokes();
foreach (Stroke stroke in targetStrokes)
{
stroke.Transform(m, false);
}

List<UIElement> selectedElements = InkCanvasElementsHelper.GetSelectedElements(inkCanvas);
foreach (UIElement element in selectedElements)
{
ApplyElementMatrixTransform(element, m);
}

StrokeCollection targetStrokes = inkCanvas.GetSelectedStrokes();
foreach (Stroke stroke in targetStrokes)
{
stroke.Transform(m, false);
}

if (DrawingAttributesHistory.Count > 0)
{
timeMachine.CommitStrokeDrawingAttributesHistory(DrawingAttributesHistory);
Expand Down
4 changes: 4 additions & 0 deletions Ink Canvas/MainWindow_cs/MW_TimeMachine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ private void Stroke_StylusPointsChanged(object sender, EventArgs e)

private void ToCommitStrokeManipulationHistoryAfterMouseUp()
{
if (StrokeManipulationHistory == null && ElementsManipulationHistory == null)
{
return;
}
timeMachine.CommitStrokeManipulationHistory(StrokeManipulationHistory, ElementsManipulationHistory);
if (StrokeManipulationHistory != null)
{
Expand Down

0 comments on commit 4f2f4bf

Please sign in to comment.