Inflate padding to account for scaling

- Issue MatterHackers/MCCentral#3236
Incorrect menu size when scaled to minimum size (0.7)
This commit is contained in:
John Lewin 2018-04-27 17:29:13 -07:00
parent 29f42eed54
commit 3b31a77d32
2 changed files with 4 additions and 2 deletions

View file

@ -302,7 +302,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
public MenuItem(GuiWidget content, ThemeConfig theme)
: base (theme)
{
this.Padding = new BorderDouble(left: theme.MenuGutterWidth, right: 15);
// Inflate padding to match the target (MenuGutterWidth) after scale operation in assignment
this.Padding = new BorderDouble(left: Math.Ceiling(theme.MenuGutterWidth / GuiWidget.DeviceScale) , right: 15);
this.BackgroundColor = theme.Colors.PrimaryBackgroundColor;
this.HAnchor = HAnchor.MaxFitOrStretch;
this.VAnchor = VAnchor.Fit;

View file

@ -448,7 +448,8 @@ namespace MatterHackers.MatterControl
widget.DebugShowBounds = false;
}
if (scene.DebugItem != null
if (scene != null
&& scene.DebugItem != null
&& tabControl1.SelectedIndex != 1)
{
scene.DebugItem = null;