From 603f8a2c6bb44d9c3753887180d76e0653b50d27 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 2 Sep 2025 11:10:11 -0600 Subject: [PATCH] auto-ify a loop in the canvas ruler rendering code --- libs/canvas/ruler.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/canvas/ruler.cc b/libs/canvas/ruler.cc index 92b76f35f8..51c10be181 100644 --- a/libs/canvas/ruler.cc +++ b/libs/canvas/ruler.cc @@ -170,11 +170,11 @@ Ruler::render (Rect const & area, Cairo::RefPtr cr) const Pango::FontDescription* last_font_description = nullptr; Coord prev = -1; - for (vector::const_iterator m = marks.begin(); m != marks.end(); ++m) { + for (auto const & mark : marks) { Duple pos; Pango::FontDescription* fd; - switch (m->style) { + switch (mark.style) { case Mark::Major: fd = _font_description; break; @@ -187,7 +187,7 @@ Ruler::render (Rect const & area, Cairo::RefPtr cr) const break; } - pos.x = round (m->position/_metric->units_per_pixel) + self.x0; + pos.x = round (mark.position/_metric->units_per_pixel) + self.x0; pos.y = self.y1; /* bottom edge */ if (pos.x < 0) { @@ -201,10 +201,10 @@ Ruler::render (Rect const & area, Cairo::RefPtr cr) const /* and the text */ - if (!m->label.empty()) { + if (!mark.label.empty()) { Pango::Rectangle logical; - layout->set_text (m->label); + layout->set_text (mark.label); logical = layout->get_pixel_logical_extents (); if ((prev >= 0.) && ((pos.x - prev) < (6. + logical.get_width()))) { @@ -228,7 +228,7 @@ Ruler::render (Rect const & area, Cairo::RefPtr cr) const cr->move_to (pos.x, pos.y); } - switch (m->style) { + switch (mark.style) { case Mark::Major: if (_divide_height >= 0) { cr->rel_line_to (0, -_divide_height);