Skip to content

Conversation

ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Oct 2, 2025

Objective

TextPipeline::queue_text temporarily takes the buffer from its glyph_info field, so that it can be used in a call to TextPipeline::update_buffer. It then replaces it when the function exits. This is a bit fragile, as the function has two exit points.

Solution

Replace it immediately after calling update_buffer, and then access it with self for the rest of the function.

…r so it can use it in a call to `TextPipeline::update_buffer`. It then replaces it when the function exits. This is a bit fragile, instead replace it immediately after calling `update_buffer` and then access it using `self` for the rest of the function.
@ickshonpe ickshonpe added C-Code-Quality A section of code that is hard to understand or change A-Text Rendering and layout for characters D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 2, 2025
Co-authored-by: Dimitrios Loukadakis <dloukadakis@users.noreply.github.com>
@dloukadakis dloukadakis 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 Oct 2, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 6, 2025
Merged via the queue into bevyengine:main with commit 35c7709 Oct 6, 2025
38 checks passed
tigregalis pushed a commit to tigregalis/bevy that referenced this pull request Oct 7, 2025
# Objective

`TextPipeline::queue_text` temporarily `take`s the buffer from its
`glyph_info` field, so that it can be used in a call to
`TextPipeline::update_buffer`. It then replaces it when the function
exits. This is a bit fragile, as the function has two exit points.

## Solution

Replace it immediately after calling `update_buffer`, and then access it
with `self` for the rest of the function.

---------

Co-authored-by: Dimitrios Loukadakis <dloukadakis@users.noreply.github.com>
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.

3 participants