[librsvg: 1/15] Pass the StrokeLinecap instead of the ComputedValues to PathHelper::new




commit 60a37304f53b1b79c83b85aa914ba9d007daf86e
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Dec 1 13:49:03 2020 -0600

    Pass the StrokeLinecap instead of the ComputedValues to PathHelper::new
    
    That parameter is the only thing that PathHelper needs; it doesn't
    need the whole ComputedValues.

 src/drawing_ctx.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index f9fdfa50..47269070 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -101,13 +101,13 @@ impl<'a> PathHelper<'a> {
         cr: &'a cairo::Context,
         transform: Transform,
         path: &'a Path,
-        values: &ComputedValues,
+        linecap: StrokeLinecap,
     ) -> Self {
         PathHelper {
             cr,
             transform,
             path,
-            is_square_linecap: values.stroke_line_cap() == StrokeLinecap::Square,
+            is_square_linecap: linecap == StrokeLinecap::Square,
             has_path: None,
         }
     }
@@ -1304,7 +1304,7 @@ impl DrawingCtx {
         self.with_discrete_layer(node, acquired_nodes, values, clipping, &mut |an, dc| {
             let cr = dc.cr.clone();
             let transform = dc.get_transform();
-            let mut path_helper = PathHelper::new(&cr, transform, path, values);
+            let mut path_helper = PathHelper::new(&cr, transform, path, values.stroke_line_cap());
 
             if clipping {
                 cr.set_fill_rule(cairo::FillRule::from(values.clip_rule()));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]