Skip to content

Commit

Permalink
Fix bug where vertical smoothing doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
doonv committed Jan 31, 2024
1 parent f419a23 commit 461ba76
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,11 @@ pub(crate) fn smooth_camera(
// we can move the viewport's transform by the remainder of the subpixel.
//
// The smoothing is based on this video: https://youtu.be/jguyR4yJb1M?t=98
let remainder = *subpixel_pos % 1.0;
let remainder = Vec2 {
x: subpixel_pos.x % 1.0,
// The y axis on sprite.rect is inverted, so we need to invert our y to counteract this.
y: -subpixel_pos.y % 1.0,
};

sprite.rect = Some(Rect {
min: Vec2::ONE + remainder,
Expand Down

0 comments on commit 461ba76

Please sign in to comment.