Improve symbol styling to differentiate between +/- direction

This commit is contained in:
jlewin 2019-02-26 18:08:02 -08:00
parent 7f6fcd55c9
commit b8230cb66d
2 changed files with 16 additions and 24 deletions

View file

@ -131,13 +131,13 @@ namespace MatterHackers.MatterControl
var centerX = this.LocalBounds.XCenter + .5;
var centerY = this.LocalBounds.YCenter - .5;
var start = new Vector2(centerX, (glyph == null) ? 20 : 9);
var start = new Vector2(centerX, (glyph == null) ? 20 : (this.IsNegative) ? 6 : 9 );
var end = new Vector2(centerX, this.LocalBounds.Height);
if (!verticalLine)
{
start = new Vector2(0, centerY);
end = new Vector2(this.LocalBounds.Width - ((glyph == null) ? 20 : 9), centerY);
end = new Vector2(this.LocalBounds.Width - ((glyph == null) ? 20 : (this.IsNegative) ? 6 : 9), centerY);
}
graphics2D.Line(start, end, lineColor, 1);
@ -145,23 +145,14 @@ namespace MatterHackers.MatterControl
// Draw line end
if (glyph != null)
{
int offset = IsNegative ? 18 : 11;
graphics2D.Render(
glyph,
verticalLine ? new Vector2(centerX, 11) : new Vector2(this.Width - 11, centerY),
verticalLine ? new Vector2(centerX, offset) : new Vector2(this.Width - offset, centerY),
lineColor);
}
// Draw negative adornment after glyphs
if (glyph != null
&& this.IsNegative)
{
graphics2D.Line(
verticalLine ? new Vector2(centerX, 0) : new Vector2(this.Width - 5, centerY),
verticalLine ? new Vector2(centerX, 5) : new Vector2(this.Width, centerY),
lineColor,
1);
}
base.OnDraw(graphics2D);
}