[librsvg: 9/27] compute_stroke_and_fill_box - use NormalizeParams




commit 787df347fe94d57c0c58521e92dc4d852b19b1c7
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri May 7 20:03:09 2021 -0500

    compute_stroke_and_fill_box - use NormalizeParams

 src/drawing_ctx.rs | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index 21b42d3a..52aa5a09 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -1236,7 +1236,7 @@ impl DrawingCtx {
             let mut bounding_box: Option<BoundingBox> = None;
             path_helper.unset();
 
-            let params = dc.get_view_params();
+            let view_params = dc.get_view_params();
 
             for &target in &values.paint_order().targets {
                 // fill and stroke operations will preserve the path.
@@ -1245,7 +1245,7 @@ impl DrawingCtx {
                     PaintTarget::Fill | PaintTarget::Stroke => {
                         path_helper.set()?;
                         let bbox = bounding_box.get_or_insert_with(|| {
-                            compute_stroke_and_fill_box(&cr, &values, &params)
+                            compute_stroke_and_fill_box(&cr, &values, &view_params)
                         });
 
                         if values.is_visible() {
@@ -1726,7 +1726,7 @@ fn get_clip_in_user_and_object_space(
 fn compute_stroke_and_fill_box(
     cr: &cairo::Context,
     values: &ComputedValues,
-    params: &ViewParams,
+    view_params: &ViewParams,
 ) -> BoundingBox {
     let affine = Transform::from(cr.get_matrix());
 
@@ -1763,7 +1763,10 @@ fn compute_stroke_and_fill_box(
     // So, see if the stroke width is 0 and just not include the stroke in the
     // bounding box if so.
 
-    let stroke_width = values.stroke_width().0.normalize(values, &params);
+    let stroke_width = values
+        .stroke_width()
+        .0
+        .to_user(&NormalizeParams::new(values, view_params));
 
     if !stroke_width.approx_eq_cairo(0.0) && values.stroke().0 != PaintServer::None {
         let (x0, y0, x1, y1) = cr.stroke_extents();


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