mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-12 00:46:57 -06:00
The page router (canvas/page_router.rs): a page module answers "what of mine is under this point?" in one hit test, which gives a Hit (an owner, a layer, a cursor, a tip). On the frame of a press, the hits at the press point decide who it belongs to, by PR 2's table (the highest layer the tool reaches), and the router holds that capture until the button is up and its release has been seen; automation's cancel and Escape drop it. The pointer's hits claim the cursor and the tip, after the tools that are not converted yet, as before. Comments: comments::hit is the module's only hit test, with each tool's filter (Select: point handles, resize handles, then the comment; Fill & Sign: the same over its marks only; shape tools: the selected comment's handles only). The Select tool's drag, click and double click act on the comment and part the press was captured on, instead of testing the press origin and the release point again; fill_grabs and select_grabs ask the router while the button is down. The topmost comment is the one drawn last (/Annots order), not the last in inspection's top-edge order: over stacked comments the tip named the top one while a click selected the one underneath. Text markup declines the drag, so a click on a highlight selects it and a drag across it still selects the text. Links: the link hover is a hit (hand and target), and a click follows the link its press was on. Text selection starts unless the press is held by something that keeps its drag (a link, a comment that moves); it tested for a link under the pointer at the moment egui called the press a drag, so a drag from text onto a link selected nothing. Un-ignores a_click_on_stacked_comments_selects_the_one_drawn_on_top; new test a_drag_from_text_onto_a_link_selects_the_text. Both fail with their fix reverted (inspection order for the topmost comment; the link test at the pointer). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>