aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2024-01-21 17:32:22 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2024-01-21 17:32:22 +0100
commitd4dce0982c79714eba10d46830d7c0176cacdfdd (patch)
tree5813419556f9ddbb84e5af317ac8ed719fa0c5ea
parent79554285331846db8a1d06e2570d5acbb2f2690e (diff)
fix high scale grid visibility bug
-rw-r--r--src/ui/graph.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ui/graph.rs b/src/ui/graph.rs
index 14f0c7d..d02b587 100644
--- a/src/ui/graph.rs
+++ b/src/ui/graph.rs
@@ -80,8 +80,8 @@ pub struct GraphState {
impl GraphState {
fn view_rectangle(&self, frame: &Frame, step: usize) -> Rectangle {
let s = Size::new(
- self.map_to_step(frame.width() / self.scale + 2.0 * step as f32, step),
- self.map_to_step(frame.height() / self.scale + 2.0 * step as f32, step),
+ self.map_to_step((frame.width() / self.scale) * step as f32 + 10.0, step),
+ self.map_to_step((frame.height() / self.scale) * step as f32 + 10.0, step),
);
let p = Point::new(
self.map_to_step(-self.center.x / self.scale - s.width / 2.0, step),