Skip to content

Commit

Permalink
reverted new storagebasedchange
Browse files Browse the repository at this point in the history
  • Loading branch information
flabbet committed Dec 18, 2021
1 parent 931d1f9 commit 12c0e3d
Show file tree
Hide file tree
Showing 3 changed files with 435 additions and 142 deletions.
26 changes: 13 additions & 13 deletions PixiEditor/Models/Tools/BitmapOperationTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,26 @@ public override void AfterUse(SKRectI sessionRect)
private void InitializeStorageBasedChange(SKRectI toolSessionRect)
{
Document doc = ViewModels.ViewModelMain.Current.BitmapManager.ActiveDocument;
var toolSize = Toolbar.GetSetting<SizeSetting>("ToolSize");
SKRectI finalRect = toolSessionRect;
if (toolSize != null)
{
int halfSize = (int)Math.Ceiling(toolSize.Value / 2f);
finalRect.Inflate(halfSize, halfSize);
}
//var toolSize = Toolbar.GetSetting<SizeSetting>("ToolSize");
//SKRectI finalRect = toolSessionRect;
//if (toolSize != null)
//{
// int halfSize = (int)Math.Ceiling(toolSize.Value / 2f);
// finalRect.Inflate(halfSize, halfSize);
//}

if (toolSessionRect.IsEmpty)
{
finalRect = SKRectI.Create(doc.ActiveLayer.OffsetX, doc.ActiveLayer.OffsetY, doc.ActiveLayer.Width, doc.ActiveLayer.Height);
}
//if (toolSessionRect.IsEmpty)
//{
// finalRect = SKRectI.Create(doc.ActiveLayer.OffsetX, doc.ActiveLayer.OffsetY, doc.ActiveLayer.Width, doc.ActiveLayer.Height);
//}

//Commented, because rect based undo is still a little buggy
//if (UseDocumentRectForUndo)
//{
finalRect = SKRectI.Create(0, 0, doc.Width, doc.Height);
// finalRect = SKRectI.Create(0, 0, doc.Width, doc.Height);
//}

_change = new StorageBasedChange(doc, new[] { new LayerChunk(doc.ActiveLayer, finalRect) });
_change = new StorageBasedChange(doc, new[] { doc.ActiveLayer });
}

private void UndoStorageBasedChange(Layer[] layers, UndoLayer[] data, object[] args)
Expand Down

0 comments on commit 12c0e3d

Please sign in to comment.