diff --git a/OpenNest.WinForms.Tests/Controls/LayoutPartLabelZoomTests.cs b/OpenNest.WinForms.Tests/Controls/LayoutPartLabelZoomTests.cs index 15460dcc..0a449e9c 100644 --- a/OpenNest.WinForms.Tests/Controls/LayoutPartLabelZoomTests.cs +++ b/OpenNest.WinForms.Tests/Controls/LayoutPartLabelZoomTests.cs @@ -54,7 +54,7 @@ public class LayoutPartLabelZoomTests using var image = new Bitmap(120, 120); using var g = Graphics.FromImage(image); g.Clear(Color.White); - layout.DrawLabel(g, "12", muted: false, Brushes.Yellow); + layout.DrawLabel(g, "12", Brushes.Yellow, Brushes.Black); Assert.Equal(shown, !IsBlank(image)); layout.ReleaseDisplayResources(); diff --git a/OpenNest/Controls/PlateRenderer.cs b/OpenNest/Controls/PlateRenderer.cs index e80781c7..25a127bd 100644 --- a/OpenNest/Controls/PlateRenderer.cs +++ b/OpenNest/Controls/PlateRenderer.cs @@ -281,9 +281,11 @@ namespace OpenNest.Controls { DrawCutOffLines(g); - // Over the lines, on a disc of the plate's color, so the cut does not strike them through. + // Over the lines, on a disc of the line's color so the cut does not strike them through. + // A disc of the plate's color read as a notch in any part edge the cut runs along. + using var disc = new SolidBrush(CutOffLineColor); foreach (var (part, id, muted) in cutOffLabels) - part.DrawLabel(g, id, muted, view.ColorScheme.LayoutFillBrush); + part.DrawLabel(g, id, muted ? Brushes.Gray : disc, Brushes.White); cutOffLabels.Clear(); } diff --git a/OpenNest/LayoutPart.cs b/OpenNest/LayoutPart.cs index 8c5bb413..228b5d98 100644 --- a/OpenNest/LayoutPart.cs +++ b/OpenNest/LayoutPart.cs @@ -173,7 +173,7 @@ namespace OpenNest /// Draws the id over a disc of , so a line drawn through the /// label's point, such as a cut-off's own cut, does not strike through the number. /// - internal void DrawLabel(Graphics g, string id, bool muted, Brush background) + internal void DrawLabel(Graphics g, string id, Brush background, Brush text) { var size = MeasureLabel(g, id); if (!LabelFits(size)) @@ -181,7 +181,7 @@ namespace OpenNest var diameter = LabelDiscDiameter(size); g.FillEllipse(background, _labelScreenPoint.X - diameter / 2, _labelScreenPoint.Y - diameter / 2, diameter, diameter); - DrawLabel(g, id, muted); + g.DrawString(id, ProgramIdFont, text, _labelScreenPoint.X, _labelScreenPoint.Y, LabelFormat); } private SizeF MeasureLabel(Graphics g, string id)