Round re-slice button

This commit is contained in:
LarsBrubaker 2021-02-25 07:16:15 -08:00
parent daa407bf83
commit 9ff23ae662
2 changed files with 20 additions and 13 deletions

View file

@ -155,22 +155,23 @@ namespace MatterHackers.MatterControl.CustomWidgets
public override void OnDrawBackground(Graphics2D graphics2D)
{
var bounds = this.LocalBounds;
bounds -= BackgroundInset;
var rect = new RoundedRect(bounds.Left, bounds.Bottom, bounds.Right, bounds.Top, RoundRadius);
if (BackgroundColor.Alpha0To255 > 0)
{
var bounds = this.LocalBounds;
bounds -= BackgroundInset;
var rect = new RoundedRect(bounds.Left, bounds.Bottom, bounds.Right, bounds.Top, RoundRadius);
graphics2D.Render(rect, BackgroundColor);
}
if (RenderOutline)
{
var stroke = 1 * GuiWidget.DeviceScale;
var expand = stroke / 2;
rect = new RoundedRect(bounds.Left + expand, bounds.Bottom + expand, bounds.Right - expand, bounds.Top - expand, RoundRadius);
var rectOutline = new Stroke(rect, stroke);
if (BorderColor.Alpha0To255 > 0 && RenderOutline)
{
var stroke = 1 * GuiWidget.DeviceScale;
var expand = stroke / 2;
rect = new RoundedRect(bounds.Left + expand, bounds.Bottom + expand, bounds.Right - expand, bounds.Top - expand, RoundRadius);
var rectOutline = new Stroke(rect, stroke);
graphics2D.Render(rectOutline, BorderColor);
}
graphics2D.Render(rectOutline, BorderColor);
}
}