Fix selection highlight brush

This commit is contained in:
Niels Martin Hansen 2022-08-17 15:54:54 +02:00
parent b43c374d86
commit 2465e94206

View file

@ -44,7 +44,7 @@ public class CutOutTool : BaseTool
private Size buttonSize = new Size(80, 40); private Size buttonSize = new Size(80, 40);
private int buttonOffset = 15; private int buttonOffset = 15;
private Brush EffectBrush = new SolidBrush(Color.FromArgb(128, Color.Gray)); private Brush selectionHighlightBrush = new SolidBrush(Color.FromArgb(128, Color.Gray));
public override void OnUpdate() public override void OnUpdate()
{ {
@ -109,11 +109,11 @@ public override void OnDraw(Graphics g)
{ {
if (IsHorizontalTrim) if (IsHorizontalTrim)
{ {
g.FillRectangle(EffectBrush, new RectangleF(Rectangle.X, g.ClipBounds.Y, Rectangle.Width, g.ClipBounds.Height)); g.FillRectangle(selectionHighlightBrush, new RectangleF(Rectangle.X, g.ClipBounds.Y, Rectangle.Width, g.ClipBounds.Height));
} }
else if (IsVerticalTrim) else if (IsVerticalTrim)
{ {
g.FillRectangle(EffectBrush, new RectangleF(g.ClipBounds.X, Rectangle.Y, g.ClipBounds.Width, Rectangle.Height)); g.FillRectangle(selectionHighlightBrush, new RectangleF(g.ClipBounds.X, Rectangle.Y, g.ClipBounds.Width, Rectangle.Height));
} }
} }
@ -169,6 +169,8 @@ public override void Dispose()
{ {
base.Dispose(); base.Dispose();
selectionHighlightBrush.Dispose();
if ((confirmButton != null && confirmButton.IsCursorHover) || (cancelButton != null && cancelButton.IsCursorHover)) if ((confirmButton != null && confirmButton.IsCursorHover) || (cancelButton != null && cancelButton.IsCursorHover))
{ {
Manager.Form.SetDefaultCursor(); Manager.Form.SetDefaultCursor();