From 215b7140fb75787edba3e96d652fd40029b6f2fe Mon Sep 17 00:00:00 2001 From: Lars Brubaker Date: Tue, 3 Aug 2021 18:10:42 -0700 Subject: [PATCH] improving histogram drawing --- .../DesignTools/Operations/Image/Histogram.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/MatterControlLib/DesignTools/Operations/Image/Histogram.cs b/MatterControlLib/DesignTools/Operations/Image/Histogram.cs index 515bd132e..c6570910b 100644 --- a/MatterControlLib/DesignTools/Operations/Image/Histogram.cs +++ b/MatterControlLib/DesignTools/Operations/Image/Histogram.cs @@ -146,10 +146,15 @@ namespace MatterHackers.MatterControl.DesignTools .First().value; var graphics2D2 = _histogramRawCache.NewGraphics2D(); graphics2D2.Clear(ApplicationController.Instance.Theme.SlightShade); + + var graphShape = new VertexStorage(); + graphShape.MoveTo(0, 0); for (int i = 0; i < 256; i++) { - graphics2D2.Line(i, 0, i, Easing.Exponential.Out(counts[i] / max) * _histogramRawCache.Height, Color.Black); + graphShape.LineTo(i, Easing.Exponential.Out(counts[i] / max) * _histogramRawCache.Height); } + graphShape.LineTo(image.Width, 0); + graphics2D2.Render(graphShape, 0, 0, theme.TextColor); } public GuiWidget NewEditWidget(ThemeConfig theme) @@ -194,7 +199,7 @@ namespace MatterHackers.MatterControl.DesignTools leftEdge.LineTo(w * s, h * .40); leftEdge.curve3(w * s, h * .30, w * .5, h * .30); leftEdge.curve3(w * e, h * .20); - g.Render(new FlattenCurves(leftEdge), theme.TextColor); + g.Render(new FlattenCurves(leftEdge), theme.PrimaryAccentColor); g.Line(w * .35, h * .6, w * .35, h * .4, theme.BackgroundColor); g.Line(w * .65, h * .6, w * .65, h * .4, theme.BackgroundColor); }