Open gloridifice opened 2 months ago
Seeing this happen as well. I'm not exactly sure the root cause. But, my best guess as of now is that
ui_state.viewport_rect.size()
is producing some absurd size on the first call. I'm not familiar enough with the codebase to provide more thoughts 🤔 .
If you modify you code as follows it'll at least get you working again:
if viewport_size.x > window.resolution.physical_width() as f32
|| viewport_size.y > window.resolution.physical_height() as f32
{
return;
}
cam.viewport = Some(bevy::render::camera::Viewport {
physical_position: UVec2::new(viewport_pos.x as u32, viewport_pos.y as u32),
physical_size: UVec2::new( viewport_size.x as u32, viewport_size.y as u32),
depth: 0.0..1.0,
});
Log: https://gist.github.com/gloridifice/088ce7de2c1502ccf86dd8bd9691b0c4