diff --git a/Cargo.toml b/Cargo.toml index 7b726fc4..9006ab6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 } diff --git a/src/renderer.rs b/src/renderer.rs index 5661c619..177b3762 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -524,6 +524,17 @@ 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()?; Ok(text_areas)