From 46f6948083a9495188bc292e09b07dd5a50a466e Mon Sep 17 00:00:00 2001 From: Arnaud Gourlay Date: Sat, 15 Feb 2025 20:38:15 +0100 Subject: [PATCH] [design & perf] starting measure vertical line only once --- src/ui/canvas_measure.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/ui/canvas_measure.rs b/src/ui/canvas_measure.rs index c639b10..2e80fca 100644 --- a/src/ui/canvas_measure.rs +++ b/src/ui/canvas_measure.rs @@ -153,14 +153,15 @@ impl canvas::Program for CanvasMeasure { let color_gray = Color::from_rgb8(0x40, 0x44, 0x4B); let color_dark_red = Color::from_rgb8(200, 50, 50); - // draw first measure vertical line - // TODO draw only for the first measure because the end measure will be the start of the next measure - draw_measure_vertical_line( - frame, - vertical_measure_height, - measure_start_x, - measure_start_y, - ); + // draw first vertical line only for measure at the of rows + if bounds.x == MEASURE_NOTES_PADDING { + draw_measure_vertical_line( + frame, + vertical_measure_height, + measure_start_x, + measure_start_y, + ); + } // draw focused box if self.is_focused {