🐛 GCV: Fix dragging w/ center origin & bed changes

Minor refactoring to get rid of three problems. Not only is #4115 as
introduced by 886c3d9449 fixed but changes
to the bed dimensions after printer profile change now trigger a proper
viewport reset (zoom & translation) and there's now also a button to
reset the viewport to a sensible default should you get completely lost
in the viewer canvas.

Closes #4115
This commit is contained in:
Gina Häußge committed 2021-05-03 11:06:24 +02:00
1 parent 2494736d5f
commit 19c39588e6
4 files changed
+77 -51

No files matched your search

@@ -214,6 +214,9 @@ $(function () {
self.settings.printerProfiles
.currentProfileData()
.volume.formFactor.subscribe(self._printerProfileUpdated);
self.settings.printerProfiles
.currentProfileData()
.volume.origin.subscribe(self._printerProfileUpdated);
}
if (self.settings.printerProfiles.currentProfileData().axes) {
self.settings.printerProfiles
@@ -393,6 +396,10 @@ $(function () {
self.clear();
};
self.resetViewport = function () {
GCODE.ui.resetViewport();
};
self.resetOptions = function () {
self.renderer_centerModel(false);
self.renderer_centerViewport(false);