Files
OrcaSlicer-KX/src
Robert J Audas aa92168582 feat: double-click object list row to frame object in 3D view (#13804)
* feat: double-click object list row to frame object in 3D view

Resolves #13800.

Extends the existing wxEVT_DATAVIEW_ITEM_ACTIVATED handler in
ObjectList::create_objects_ctrl() so that double-clicking an
object / part / instance row calls GLCanvas3D::zoom_to_selection().
This mirrors the existing "Fit camera to scene or selected object"
canvas button, exposed via a natural mouse trigger from the list.
The current view angle is preserved (Blender-style "Frame Selected").

Scope kept intentionally small:
- Object / Part / Instance rows -> zoom_to_selection().
- Filament-color column -> unchanged (still opens color editor).
- Plate rows -> unchanged (no-op).
- Inert in slice-preview mode via get_current_canvas3D(true).

Authored with assistance from Claude (Anthropic).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix: no-op object-list double-click in slice-preview mode

Following up on #13800 / #13804. The original guard used
get_current_canvas3D(true)'s `exclude_preview` flag, expecting that to
return nullptr when the preview canvas is active. In fact the flag
falls through to the editor canvas as a default, so the handler was
still calling zoom_to_selection() on the editor canvas — and since the
camera is shared between the editor and preview canvases, the move
was visible in the preview view as the camera jumping to empty world
positions (sliced or excluded, sliced or not).

Replace the misnamed flag with an explicit is_preview_shown() guard
that returns early before any canvas lookup. Manually verified:
preview mode now ignores object-list double-clicks; prepare-mode
behavior unchanged.

Authored with assistance from Claude (Anthropic).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
2026-06-04 18:23:01 +08:00
..