Skip to content

Conversation

@SpecificProtagonist
Copy link
Contributor

Objective

Image::resize currently prints a warning when resizing an uninitialized Image, even though the resizing works correctly. For code that doesn't care about whether the image is initialized CP-side, this is inconvenient and unnecessary.

@SpecificProtagonist SpecificProtagonist added A-Rendering Drawing game state to the screen S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels May 7, 2025
/// Does not properly resize the contents of the image, but only its internal `data` buffer.
/// Does not properly scale the contents of the image.
pub fn resize(&mut self, size: Extent3d) {
self.texture_descriptor.size = size;
Copy link
Member

@ThierryBerger ThierryBerger May 17, 2025

Choose a reason for hiding this comment

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

Nit: It's probably out of scope for this PR, but setting the size when we don't have any data feels weird. I'd put this in the condition 🤔 (and comment that it does nothing when called with a self.data equal to None.

The best would probably to return an Error, so user can react, but as self.data is exposed the test can just exist in user space.

@ThierryBerger ThierryBerger 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 May 17, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 26, 2025
Merged via the queue into bevyengine:main with commit 57eda2e May 26, 2025
34 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Jun 9, 2025
# Objective

Follow up for #19116 and #19098

## Testing

viewport_node example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants