Expand description
Transformed picking for transform3d layers.
Layer promotion is render-side only, so a 3D-transformed subtree’s nodes keep their untransformed layout rects on the window camera — the stock hit-test sees them where layout put them, not where the composite quad draws them. This module makes picking follow the visual:
drive_transform3d_pointerinverts the cursor through the topmost transformed layer’s screen homography onto the layer plane and drives a sharedPointerId::Customvirtual pointer at the recovered untransformed window position — stock picking then resolves the subtree’s descendants normally (the<surface>virtual-pointer pattern, but window-target).suppress_transformed_layer_hitsdrops the real mouse pointer’s hits on members of visually-transformed layers (their layout rects are visually stale) and scopes the virtual pointer’s hits to the layer it is remapping into (its window location overlaps unrelated nodes).correct_transformed_interactionsre-derives the legacyInteractionfor those members from the virtual pointer’sHoverMapentry —ui_focus_systemruns its own geometric hit-test that neither 1 nor 2 reaches.
Identity-valued transforms keep everything here inert (visual == layout); nested transformed-in-transformed layers invert the nearest transformed root only — a documented v1 limitation. Click-through under the visual quad (the real pointer hitting non-members the transformed result covers) is out of scope for v1.
Structs§
- Transform3d
Pointer - The single virtual pointer remapping cursor input into transformed layers (topmost-wins, like the one surface pointer serving every surface), plus its frame-to-frame state.
Constants§
- TRANSFOR
M3D_ POINTER_ UUID - The transform3d virtual pointer’s fixed id (see
[
crate::surface::SURFACE_POINTER_UUID] for the pattern).
Functions§
- correct_
transformed_ interactions - Re-derive the legacy
Interaction— andRelativeCursorPosition— for members of visually-transformed layers from the virtual pointer (HoverMapentry + press state + remapped location).ui_focus_systemcomputes both geometrically from the real cursor against the stale layout rect (suppress_transformed_layer_hitsnever reaches it), so without this the real pointer lights hover/press styling — and reports drag positions — where layout put the subtree, not where it renders. Runs beforeapply_interaction_styles/collect_hover_events/collect_pointer_eventsso styling, enter/leave, andonPointer*positions all see the corrected state. - drive_
transform3d_ pointer - Remap the window cursor into the topmost visually-transformed layer under
it and drive the virtual pointer there (
PointerInputmove/press/release, the surface driver’s contract). With no transformed layer under the cursor — or no transformed layers at all — the pointer parks off-bounds and releases owed presses. - init_
transform3d_ pointer - Spawn the virtual pointer at startup and publish its id.
- invert_
screen_ to_ plane - Map a physical-px screen position back onto the layer plane (untransformed
physical px).
Nonewhen the plane is edge-on (degenerate homography), the recovered point sits at infinity, or it lies behind the eye (past the vanishing line, where the quad is not visible). A backface (negative determinant) still inverts — backfaces render and stay clickable. - suppress_
transformed_ layer_ hits - Scope picking hits around the transformed-layer remap: the real mouse pointer must not hit members of visually-transformed layers (their layout rects are stale), and the virtual pointer must hit only members of the layer it is remapping into (its window location overlaps whatever else layout put there). Runs between the picking backends and the hover-map update, after the clip filter.
- visually_
transformed_ members - The set of entities that belong to a visually-transformed layer this frame — the members the window cursor scan must skip (their layout rects are stale). Empty when no layer is transformed.