feat: add explicit left/right orientation with swap button

Fixes mirrored slice exports by making orientation explicit:

- PhotoSlice.swapped flag persists a user left/right swap
- swap_left_right() mirrors [TL,TR,BR,BL] -> [TR,TL,BL,BR]
- normalize_top_left() honors the flag so squarize/reset_rotation
  no longer overwrite manual orientation
- Swap L/R toolbar button wired through canvas state + controller
- Color-code left (orange) vs right (cyan) corners and edges
This commit is contained in:
dan 2026-09-11 21:33:59 +02:00
parent 047ea60fa5
commit 607f5e0c57
7 changed files with 114 additions and 31 deletions

View file

@ -123,6 +123,16 @@ class ScanSlicerUiPreviewMixin(ScanSlicerUiSharedMixin):
)
preview_toolbar_layout.addWidget(self.active_box_reset_rotation_button)
self.active_box_swap_button = self._create_toolbar_button(
preview_toolbar,
text="Swap L/R",
tooltip="Swap left/right orientation of the active box",
icon_data_url=self.SWAP_LR_ICON_DATA_URL,
callback=self.swap_active_box_left_right,
enabled=False,
)
preview_toolbar_layout.addWidget(self.active_box_swap_button)
self.add_box_button = self._create_toolbar_button(
preview_toolbar,
text="Add box",