mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-21 07:52:32 +00:00
Design: a sketch takes its floating chrome with it when it ends
Confirming a sketch while an inline value field was open left the field behind. The editor is a top-level frame, so it survived the session that owned it, and inline_busy stayed set with it — on_mouse_impl then returned true at its first branch for every later click and the viewport was simply dead. No refusal, no message: exactly the "click the geometry, nothing happens" the pick bugs above it were mistaken for. finish() and cancel() now call close_session_chrome(): dismiss the open field (keep-as-drawn, the same contract the polyline terminators already use), drop the queue of fields behind it, and clear the corner readout — which had the same defect for the same reason, sitting on 336.8° over a committed sketch because nothing redraws the HUD once the tool stops. Verified on the rig on the exact reported sequence: line on XZ, Return to accept the length, Confirm with the Angle field still open. The field goes, the sketch commits, and the next click reaches the pick (pick trace shows down/up consumed) and selects Sketch1. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LyRwbuq6fjn3VV9U9UvhBM
This commit is contained in:
co-authored by
Claude Opus 5
parent
1addba6ea0
commit
6e9910303b
@@ -236,6 +236,7 @@ void DesignSketchTool::set_tool(Mode mode)
|
||||
|
||||
void DesignSketchTool::cancel()
|
||||
{
|
||||
close_session_chrome(); // same orphaned-field freeze as finish() — see snaporca-yce
|
||||
m_active = false;
|
||||
m_points.clear();
|
||||
m_entities.clear();
|
||||
@@ -2009,6 +2010,11 @@ void DesignSketchTool::keep_segment_as_drawn()
|
||||
|
||||
void DesignSketchTool::finish()
|
||||
{
|
||||
// A value field still open at commit time outlives the session — the editor is a top-level
|
||||
// frame — and inline_busy stays set, so every later click is swallowed at on_mouse_impl's
|
||||
// first branch and the viewport reads as dead. Dismiss it first (keep-as-drawn, the same
|
||||
// contract as the polyline terminators) and drop any queued field with it.
|
||||
close_session_chrome();
|
||||
if (op_ready()) confirm_op(); // apply a pending edit-op gizmo before committing
|
||||
if (tf_ready()) confirm_transform(); // apply a pending transform gizmo before committing
|
||||
auto cb = on_commit_entities;
|
||||
|
||||
@@ -357,6 +357,16 @@ public:
|
||||
m_autoedit_seen = int(m_entities.size());
|
||||
m_live_quotes.clear(); // rebuilt from current geometry on the next render
|
||||
}
|
||||
// Take down the session's floating chrome: the open value field (dismiss = keep-as-drawn),
|
||||
// the queue of fields behind it, and the corner readout. All three are top-level windows fed
|
||||
// only while the tool is live, so nothing else would ever clear them — reset_autoedit() alone
|
||||
// clears the flag and leaves the frame on screen. Called by finish()/cancel(); safe when
|
||||
// nothing is open.
|
||||
void close_session_chrome() {
|
||||
if (on_inline_dismiss) on_inline_dismiss(); // no-op when no field is open
|
||||
reset_autoedit();
|
||||
if (on_readout) on_readout(std::string()); // the HUD is not redrawn once the tool stops
|
||||
}
|
||||
// Ctrl+Z while sketching: drop the last drawn entity (reuses delete_selected's remap).
|
||||
bool undo_last_entity() {
|
||||
if (!m_active || m_entities.empty()) return false;
|
||||
|
||||
Reference in New Issue
Block a user