Skip to content

Commit 55283bb

Browse files
authored
Revert "Fix rounding bug in camera projection (#16828)" (#17592)
This reverts commit ae52222. # Objective Fixes #16856 ## Solution Remove rounding from `OrthographicProjection::update`, which was causing the center of the orthographic projection to be off center. ## Testing Ran the examples mentioned on #16856 and code from #16773 ## Showcase `orthographic` example ![image](https://github.com/user-attachments/assets/d3bb1480-5908-4427-b1f2-af8a5c411745) `projection_zoom` example ![image](https://github.com/user-attachments/assets/e560c81b-db8f-44f0-91f4-d6bae3ae7f32) `camera_sub_view` example ![image](https://github.com/user-attachments/assets/615e9eb8-f4e5-406a-b98a-501f7d652145) `custom_primitives` example ![image](https://github.com/user-attachments/assets/8fd7702e-07e7-47e3-9510-e247d268a3e7) #16773 code ![image](https://github.com/user-attachments/assets/1b759e90-6c53-4279-987e-284518db034b)
1 parent 756948e commit 55283bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/bevy_render/src/camera/projection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ impl CameraProjection for OrthographicProjection {
637637
ScalingMode::Fixed { width, height } => (width, height),
638638
};
639639

640-
let origin_x = (projection_width * self.viewport_origin.x).round();
641-
let origin_y = (projection_height * self.viewport_origin.y).round();
640+
let origin_x = projection_width * self.viewport_origin.x;
641+
let origin_y = projection_height * self.viewport_origin.y;
642642

643643
self.area = Rect::new(
644644
self.scale * -origin_x,

0 commit comments

Comments
 (0)