From 267082b2bee9c0dd2c855e077d03ea06b288766a Mon Sep 17 00:00:00 2001 From: John Lewin Date: Sat, 7 Apr 2018 14:26:24 -0700 Subject: [PATCH] Only call Invalidate on change - Issue MatterHackers/MCCentral#3067 Hang on MatterControl close if Extruder/Bed popup open --- PartPreviewWindow/RoundedToggleSwitch.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PartPreviewWindow/RoundedToggleSwitch.cs b/PartPreviewWindow/RoundedToggleSwitch.cs index ae013a8ca..09e4a1d5d 100644 --- a/PartPreviewWindow/RoundedToggleSwitch.cs +++ b/PartPreviewWindow/RoundedToggleSwitch.cs @@ -60,8 +60,11 @@ namespace MatterHackers.MatterControl.CustomWidgets get => _checked; set { - _checked = value; - this.Invalidate(); + if (_checked != value) + { + _checked = value; + this.Invalidate(); + } } }