Repository navigation
feat(anchor): add Cx::anchor_placement and boundary-clamped El::anchored_in / anchor_rect_in - #1939
Merged
Merged
Conversation
Hona
force-pushed
the
feat/362-anchor-placement-bounds
branch
from
November 24, 2026 14:21
02bfcca to
a35c527
Compare
…red_in / anchor_rect_in
Hona
force-pushed
the
feat/362-anchor-placement-bounds
branch
from
November 24, 2026 14:37
a35c527 to
828f60c
Compare
This was referenced Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #362
Fixes #1380
Summary
Cx::anchor_placement,memo::anchor_placement):runtime::anchor::anchor_positionnow returns(x, y, Side, Align)and storesresolved_anchor: Option<(Side, Align)>on placed anchored nodes (NodeCold). Views andmemo/regionclosures can query the resolved physical(Side, Align)after RTL mirroring, zoom, and flip clamping, participating in the existingPASSES/ECHOESsettle loop and invalidating only when the resolved placement changes (never on non-flipping scrolls or resizes).El::anchored_in,anchor_rect_in): generalizesanchor_positionandfit_boundto arbitrarybounds: [f32; 4], leavingpub struct Anchorunchanged. Chaining.anchored_in(boundary_key)after.anchoredor.anchored_fitconfines side flipping, alignment flipping, shift clamping, and fit sizing to the named boundary element's rect intersected with the window viewport, supporting forward-declared, scrolled, and zoomed boundaries and falling back to the window when the boundary key is missing or self-referential.computePosition()resolvedplacementafterflipmiddleware (Anchored popups: report which side a placement flipped to #362) andboundaryoption ondetectOverflow/flip/shift/sizemiddleware (Anchored overlays flip and clamp against the window only; add a boundary element #1380), paired with Rune'sCx::layout_with/memo::layoutread-and-settle conventions.API & Usage
Example & Docs
rune-popover--boundedstory inexamples/kit-gallery/src/stories/overlays.rs(a list pane beside an inspector drawer with a movable trigger,El::anchored_in("bounded-list-pane"), and livememo::anchor_placement("bounded-card")readout).El::anchored_in,anchor_rect_in,Cx::anchor_placement, andmemo::anchor_placement, updatedcrates/rune/README.md, and addedchangelog/unreleased/2026-11-24-anchor-placement-and-boundary.md.