Skip to content

Commit a8ec781

Browse files
committed
Fix WCS offset applied twice in Move to Selection buttons (#245)
1 parent 4c2092e commit a8ec781

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

rayforge/ui_gtk/doceditor/bottom_panel.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,14 @@ def _on_move_to_position(self, button, position: str):
554554

555555
space = self.machine.get_coordinate_space()
556556
machine_x, machine_y = space.world_point_to_machine(world_x, world_y)
557-
self.machine_cmd.move_to(self.machine, machine_x, machine_y)
557+
wcs_offset = self.machine.get_active_wcs_offset()
558+
x_off, y_off, _ = space.get_command_offset(
559+
wcs_offset=wcs_offset,
560+
wcs_is_workarea_origin=self.machine.wcs_origin_is_workarea_origin,
561+
)
562+
self.machine_cmd.move_to(
563+
self.machine, machine_x - x_off, machine_y - y_off
564+
)
558565

559566
def _on_click_to_zero_toggled(self, button):
560567
self.set_click_to_zero_mode(not self._click_to_zero_mode)

0 commit comments

Comments
 (0)