Skip to content

Commit

Permalink
Make mouse over work take scroll offset into account
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns committed Jun 24, 2024
1 parent cf5a985 commit 3618b22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/blitz/src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ where
};

let x = x / state.viewport.zoom();
let y = y / state.viewport.zoom();
let y = (y - self.scroll_offset as f32) / state.viewport.zoom();

// println!("Mouse move: ({}, {})", x, y);
// println!("Unscaled: ({}, {})",);
Expand Down Expand Up @@ -488,6 +488,8 @@ where
abs_y += y;
}

abs_y += self.scroll_offset as f32;

// Hack: scale factor
let abs_x = f64::from(abs_x) * scale;
let abs_y = f64::from(abs_y) * scale;
Expand Down

0 comments on commit 3618b22

Please sign in to comment.