Skip to content

Commit

Permalink
feat: Add debug boxes behind debug flag
Browse files Browse the repository at this point in the history
  • Loading branch information
kokoISnoTarget authored Apr 12, 2024
1 parent 3cef713 commit 408330f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ keywords = ["markdown", "viewer", "gpu"]
default = ["wayland", "x11"]
x11 = ["copypasta/x11", "winit/x11"]
wayland = ["copypasta/wayland", "winit/wayland"]
debug = []

[dependencies]
winit = { version = "0.28.7", default-features = false }
Expand Down
12 changes: 12 additions & 0 deletions src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,18 @@ impl Renderer {
}
}
}
#[cfg(feature = "debug")]
{
let mut rect = element
.bounds
.as_ref()
.context("Element not positioned")?
.clone();
rect.pos.1 -= self.scroll_y;
let color = glyphon::Color::rgb(255, 0, 255).0;
let _ =
self.stroke_rectangle(rect, native_color(color, &self.surface_format), 1.0);
}
}

self.draw_scrollbar()?;
Expand Down

0 comments on commit 408330f

Please sign in to comment.