Remove widget proxy to Clear3DGCode, call directly on model

This commit is contained in:
John Lewin 2017-06-24 10:45:02 -07:00
parent 8b3bc325cd
commit 1339f7573f
2 changed files with 7 additions and 15 deletions

View file

@ -112,7 +112,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
CreateAndAddChildren();
ActiveSliceSettings.SettingChanged.RegisterEvent(CheckSettingChanged, ref unregisterEvents);
ApplicationController.Instance.AdvancedControlsPanelReloading.RegisterEvent((s, e) => gcodeViewWidget?.Clear3DGCode(), ref unregisterEvents);
// TODO: Why do we clear GCode on AdvancedControlsPanelReloading - assume some slice settings should invalidate. If so, code should be more specific and bound to slice settings changed
ApplicationController.Instance.AdvancedControlsPanelReloading.RegisterEvent((s, e) => printer.BedPlate.GCodeRenderer?.Clear3DGCode(), ref unregisterEvents);
}
private GCodeFile loadedGCode => printer.BedPlate.LoadedGCode;
@ -154,7 +156,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
}
else if (stringEvent.Data == "extruder_offset")
{
gcodeViewWidget.Clear3DGCode();
printer.BedPlate.GCodeRenderer.Clear3DGCode();
}
}
}