Skip to content

Commit

Permalink
Fix #271
Browse files Browse the repository at this point in the history
  • Loading branch information
Equbuxu committed Dec 11, 2021
1 parent 965b15c commit aefa415
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions PixiEditor/Models/Controllers/BitmapManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,13 @@ public void UpdateHighlightIfNecessary(bool forceHide = false)
{
if (activeSession != null)
return;

HighlightPixels(forceHide ? new(-1, -1) : ToolSessionController.LastPixelPosition);
}

private void HighlightPixels(Coordinates newPosition)
{
if (ActiveDocument == null || ActiveDocument.Layers.Count == 0 || _tools.ActiveTool.HideHighlight)
if (ActiveDocument == null || ActiveDocument.Layers.Count == 0)
{
return;
}
Expand All @@ -196,7 +197,8 @@ private void HighlightPixels(Coordinates newPosition)

if (newPosition.X > ActiveDocument.Width
|| newPosition.Y > ActiveDocument.Height
|| newPosition.X < 0 || newPosition.Y < 0)
|| newPosition.X < 0 || newPosition.Y < 0
|| _tools.ActiveTool.HideHighlight)
{
previewLayer.Reset();
previewLayerSize = -1;
Expand Down
1 change: 1 addition & 0 deletions PixiEditor/ViewModels/SubViewModels/Main/ToolsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public void SetActiveTool(Tool tool)
Owner.BitmapManager.UpdateActionDisplay(LastActionTool);
//update new tool
Owner.BitmapManager.UpdateActionDisplay(ActiveTool);
Owner.BitmapManager.UpdateHighlightIfNecessary();

tool.IsActive = true;
SetToolCursor(tool.GetType());
Expand Down

0 comments on commit aefa415

Please sign in to comment.