Skip to content

Cap text animator range selector Start, End and Offset (#908) - #926

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
MarekSpodBiedry:issue-908
Oct 12, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
MarekSpodBiedry:issue-908

Conversation

@MarekSpodBiedry

Copy link
Copy Markdown
Contributor

Fixes #908.

The Range Selector's Start and End were used as typed, so values like End 300% or Start -200% stretched the selection past the text. Offset was not limited either.

range_params in crates/render/src/text.rs now limits them when the selector is evaluated:

  • Start and End: 0..100% (0..n characters/words/lines when Advanced ▸ Units is Index).
  • Offset: -100..100% (-n..n in Index units).

The limit is applied where the selector is evaluated, so it covers every way a value gets there: typed values, keyframes, expressions, scripts and Lottie import. The stored value is not changed.

Test: range_start_end_and_offset_are_capped in crates/render/src/text/tests.rs. It sets End 300% with Offset -150%, then Start -200% with Offset 100%. With the limit nothing is selected. Without it every character is selected. (Once Start and End are within 0..100%, an Offset beyond ±100% already moves the range past every character, so limiting Offset makes no visible difference and the test cannot show it on its own.)

@MarekSpodBiedry
MarekSpodBiedry marked this pull request as ready for review October 11, 2026 21:46
@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit fa8a137 into storytold:main Oct 12, 2026
h-a-n-a-s-h-i pushed a commit that referenced this pull request Oct 12, 2026
- Footage sources: the cancellable wrapper (#784) forwards frame_with (#752 float curves)
  and problem (#887); problem's default lives on the trait.
- Media: a called-off decode (#784) is not a footage problem (#887).
- Effect Controls rename (#953): Escape cancels (egui drops focus on Escape the same
  frame), the Rename item is translated; regression test.
- i18n (#873): drop the /out-i18n/ ignore rule and the note about an uncommitted script.
- Tests: text range selector caps (#926) re-borrow the layer; the RAM preview test (#793)
  sets the comp's own Resolution (#462).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@echelon

echelon commented Oct 12, 2026

Copy link
Copy Markdown
Member

Merged. Thank you for the contribution, @MarekSpodBiedry!

Small follow-up: the new test needed to re-borrow the layer after reading the project; fixed on main.

If you haven't already, come join us on Discord: https://discord.gg/artcraft. It's the best place to discuss what you're working on next and to coordinate with other contributors.

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.

[bug] text animator percent limit

3 participants