fix(grip): Stretch grip-menu action engages the grip

Picking Stretch from the grip popup just closed the menu and returned, so
the grip never became hot and the follow-up click did nothing (issue #48).
It now engages the picked grip — tracking the cursor until the placement
click — the same as picking the grip directly in the viewport.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-05-30 22:09:05 +03:00
commit e2507d5c54

View file

@ -3239,6 +3239,23 @@ impl OpenCADStudio {
use crate::entities::traits::EntityTypeOps;
use crate::scene::object::GripMenuAction;
if matches!(item.action, GripMenuAction::Stretch) {
// Stretch = move this grip. Engage it so the next click
// places it (click-move-click) — same as picking the grip
// directly in the viewport. Without this the menu just
// closed and the grip never became hot (issue #48).
if let Some(g) = self.tabs[i]
.selected_grips
.iter()
.find(|g| g.id == popup.grip_id)
{
self.tabs[i].active_grip = Some(GripEdit {
handle: popup.handle,
grip_id: popup.grip_id,
is_translate: g.is_midpoint,
origin_world: g.world,
last_world: g.world,
});
}
return Task::none();
}
// Actions that need a follow-up number stash a pending