Skip to content

Conversation

@ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Jan 5, 2026

Objective

TextPipeline::update_buffer checks per text section if the scale factor is <= 0 but if the scale factor is degenerate none of the text sections will be rendered. It would make more sense to perform the check once, at the start of the function, and return with an early error if it fails.

Solution

Add a new variant to TextError called DegenerateScaleFactor.

At the start of the update_buffer function, return with an early DegenerateScaleFactor error if the scale factor is <= 0.

…ctor is <= 0 but if the scale factor is degenerate none of the text sections will be rendered. So perform the check separately at the start of the function and return with an early error if it fails.
@ickshonpe ickshonpe changed the title Update buffer scale factor early error TextPipeline::update_buffer return with early error on degenerate scale factor Jan 5, 2026
@ickshonpe ickshonpe added A-Text Rendering and layout for characters C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 5, 2026
Copy link
Contributor

@kfc35 kfc35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example change seems unrelated, but that looks fine too so I’m approving it all

@ickshonpe
Copy link
Contributor Author

The example change seems unrelated, but that looks fine too so I’m approving it all

Didn't mean to include that, I must have based this on another PR by mistake.

@ickshonpe ickshonpe added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 6, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 7, 2026
Merged via the queue into bevyengine:main with commit 94027ad Jan 7, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Text Rendering and layout for characters C-Code-Quality A section of code that is hard to understand or change D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants