Repository navigation
feat(live): add El::live_rotation and support wrapped/truncated live_text without panicking - #1912
Merged
Merged
Conversation
…text without panicking
Hona
force-pushed
the
feat/422-live-rotation-live-text
branch
from
November 24, 2026 13:10
4bf11af to
b126576
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 #422
Refs #420
Summary
El::live_rotation): binds clockwise rotation in radians aboutEl::originto&Live<f32>,Live::smooth, or&Tween<f32>viaProperty::Rotation->prop::ROTATION, updating presented rotation, upright bounding rects, and turned hit testing without rebuilding or laying out the view.apply.rsskips staticEl::rotatecommits whileProperty::Rotationownsprop::ROTATION; unbinding restores the authoredEl::rotate(or0.0).elements.rsreportslive_intent(POSITION | SIZE) for unsmoothedlive_rotation, agreeing withMotionElement::LIVE.El::live_textwith wrap, truncation, and line clamps: removes the commit-time panic inflatten.rsand the build-time asserts inEl::live_text.live_text(including.truncate_fade()) keeps its existingTextSystem::layout_livefast path unchanged..wrap(),.truncate()/.truncate_middle()/.truncate_head(), and.max_lines(n)re-wrap or re-elide in place inside the existing content box vialay_out_live_text_in_place(Keep::Owned), without reflowing siblings or growing the shared layout/elision caches.text_input, non-text elements,.spans(),.reveal(),.secure(), links, pills, or byte-indexed text decorations) drop the live binding and keep the authored text safely.flowchart LR A[Live<f32> / Tween<f32>] -->|Property::Rotation| B[latch_live] B -->|prop::ROTATION| C[Scene & turned layer / hit test] D[LiveText] -->|plain single-line| E[TextSystem::layout_live] D -->|wrap / truncate / max_lines| F[lay_out_live_text_in_place Keep::Owned] D -->|spans / reveal / secure / input| G[degrade to authored text]Example usage
examples/live-values(rotating dial needle viaEl::live_rotation, wrapped.max_lines(2)live caption, and.truncate()live ticker).Outside answer followed
El::live_rotation: Rune's existingEl::live_scale/El::live_offset/El::rotatebuilder shape andprop::ROTATIONscene track (clockwise radians aboutEl::origin).El::live_text: Rune's existinglay_out_text_in_placefixed-box layout path (usingKeep::Ownedto keep caches bounded) and non-panicking builder degradation matching sibling text builders incrates/rune/src/el/text.rs.Notes
wasm32checks (WebGPU and WebGL) were run on Windows and macOS; a live window and Linux build (OOM in container compiling upstreamrustix) were not run.