Skip to content

fix(tools): let widgets handle a press before the select tool picks - #947

Open
PaulHax wants to merge 2 commits into
Kitware:mainfrom
PaulHax:ruler-selection-guard
Open

fix(tools): let widgets handle a press before the select tool picks#947
PaulHax wants to merge 2 commits into
Kitware:mainfrom
PaulHax:ruler-selection-guard

Conversation

@PaulHax

@PaulHax PaulHax commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

The select tool's press pick cleared the widget manager's selections before the annotation widgets handled the same press, so pressing a ruler or rectangle handle threw, and ruler line or polygon edge presses moved a handle. Defer the pick until the widgets have run.

Bug repo:

Open https://volview.kitware.app/ and load any image. A sample CT from the Data panel works.

Pick the Ruler tool from the toolbar and click twice in the axial view to place a ruler.

Switch to the Select tool (the arrow icon). Window/level, pan or zoom also work: any tool except ruler, rectangle and polygon.

Move the mouse onto one of the ruler's endpoints and wiggle it slightly until the cursor turns into a pointer. The first move after the mouse sits still doesn't register as a hover, so the wiggle matters.

Press the left button and drag.

@netlify

netlify Bot commented Sep 11, 2026

Copy link
Copy Markdown

Deploy Preview for volview-dev ready!

Name Link
🔨 Latest commit 43e4b7d
🔍 Latest deploy log https://app.netlify.com/projects/volview-dev/deploys/6aa45ffe7e5c24000875eb5b
😎 Deploy Preview https://deploy-preview-947--volview-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@PaulHax
PaulHax force-pushed the ruler-selection-guard branch from ea6a246 to 302f1d4 Compare September 11, 2026 16:29
@PaulHax PaulHax changed the title fix(tools): start a handle drag while the widget pick is unresolved fix(tools): let widgets handle a press before the select tool picks Sep 11, 2026
@PaulHax
PaulHax force-pushed the ruler-selection-guard branch from 302f1d4 to 4764eb4 Compare September 11, 2026 16:42
The select tool's press handler runs ahead of the annotation widgets and
resolves its own pick at the press position. That pick clears the widget
manager's standing selections before the widgets handle the same press,
and the ruler reads those selections to tell a handle from its line, so
pressing a hovered ruler or rectangle handle with any non-placing tool
threw. The throw also skipped the interactor's button bookkeeping, so
every pointer move with the button held re-fired the press.

Yield a microtask before picking so the widgets see the standing pick
they hovered with. The handler stays registered ahead of the widgets so
a widget consuming the press cannot skip selection, and the pick still
resolves at the press position.
Drag a ruler and a rectangle handle, click a ruler's line and drag a
polygon's edge with the select tool. The drags must move the handle with
no application error, and the line and edge presses must select the
annotation without moving a handle.
@PaulHax
PaulHax force-pushed the ruler-selection-guard branch from 4764eb4 to 43e4b7d Compare September 11, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant