From 3b31a77d32a75252df54c246a425176ce4e06f2c Mon Sep 17 00:00:00 2001 From: John Lewin Date: Fri, 27 Apr 2018 17:29:13 -0700 Subject: [PATCH] Inflate padding to account for scaling - Issue MatterHackers/MCCentral#3236 Incorrect menu size when scaled to minimum size (0.7) --- PartPreviewWindow/PopupMenu.cs | 3 ++- Utilities/InspectForm.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/PartPreviewWindow/PopupMenu.cs b/PartPreviewWindow/PopupMenu.cs index 06bd41946..ec7f10cdb 100644 --- a/PartPreviewWindow/PopupMenu.cs +++ b/PartPreviewWindow/PopupMenu.cs @@ -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; diff --git a/Utilities/InspectForm.cs b/Utilities/InspectForm.cs index 713df5020..3a2456a3e 100644 --- a/Utilities/InspectForm.cs +++ b/Utilities/InspectForm.cs @@ -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;