Skip to content

Commit

Permalink
Fix Camera2D jitter
Browse files Browse the repository at this point in the history
  • Loading branch information
forbjok committed Jan 28, 2020
1 parent 6a5ffb8 commit 33515a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scene/2d/camera_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ void Camera2D::_update_scroll() {

Transform2D xform = get_camera_transform();

// Round origin to nearest whole pixel to prevent sprite jittering
xform.set_origin(xform.get_origin().round());

viewport->set_canvas_transform(xform);

Size2 screen_size = viewport->get_visible_rect().size;
Expand Down

0 comments on commit 33515a6

Please sign in to comment.