Repository navigation
FromTemplate field defaults (ImageRenderTargetTemplate::scale_factor defaults to 0) #26115
rectalogic
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
bevy::camera::ImageRenderTargetTemplate::scale_factordefaults to 0 which is not valid and results in a panic when used.So this doesn't work:
You need to be explicit:
However this results in a clippy warning because the
FromTemplatederive adds..Default::default()and we already specified all fields:Should the
FromTemplatederive support a#[template(default = XX)]field annotation, so thenImageRenderTargetcould be defined as:bevy/crates/bevy_camera/src/camera.rs
Lines 985 to 993 in c9c21c2
All reactions