From 4c5c7769bb7eb62d47976f8f94cae913b33b546d Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 15 Sep 2023 09:58:59 -0600 Subject: [PATCH] canvas: skip intermediate Canvas::Rect object (trivial optimization) --- libs/canvas/line_set.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libs/canvas/line_set.cc b/libs/canvas/line_set.cc index 84df65fa5b..78d018d4c5 100644 --- a/libs/canvas/line_set.cc +++ b/libs/canvas/line_set.cc @@ -116,14 +116,12 @@ LineSet::render (Rect const & area, Cairo::RefPtr context) const } self = item_to_window (self); - Rect isect = self.intersection (area); + Rect intersection = self.intersection (area); - if (!isect) { + if (!intersection) { continue; } - Rect intersection (isect); - Gtkmm2ext::set_source_rgba (context, l.color); context->set_line_width (l.width);