[librsvg: 24/31] Shape now has its ShapeRendering




commit 2ad9bfa65e4aa87b56a586860a98834f8a38ad41
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Jun 2 20:09:06 2021 -0500

    Shape now has its ShapeRendering

 src/drawing_ctx.rs | 2 +-
 src/shapes.rs      | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index 39881d13..35ee0900 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -1228,7 +1228,7 @@ impl DrawingCtx {
                     return Ok(dc.empty_bbox());
                 }
 
-                cr.set_antialias(cairo::Antialias::from(values.shape_rendering()));
+                cr.set_antialias(cairo::Antialias::from(shape.shape_rendering));
 
                 setup_cr_for_stroke(&cr, &shape.stroke);
 
diff --git a/src/shapes.rs b/src/shapes.rs
index b3c7dc03..a19b07c3 100644
--- a/src/shapes.rs
+++ b/src/shapes.rs
@@ -18,6 +18,7 @@ use crate::paint_server::PaintSource;
 use crate::parsers::{optional_comma, Parse, ParseValue};
 use crate::path_builder::{LargeArc, Path as SvgPath, PathBuilder, Sweep};
 use crate::path_parser;
+use crate::property_defs::ShapeRendering;
 use crate::xml::Attributes;
 
 #[derive(Copy, Clone, PartialEq)]
@@ -37,6 +38,7 @@ pub struct Shape {
     pub stroke: Stroke,
     pub stroke_paint: PaintSource,
     pub fill_paint: PaintSource,
+    pub shape_rendering: ShapeRendering,
 }
 
 impl ShapeDef {
@@ -79,12 +81,15 @@ macro_rules! impl_draw {
                     values.color().0,
                 );
 
+                let shape_rendering = values.shape_rendering();
+
                 let shape = Shape {
                     path: shape_def.path,
                     markers: shape_def.markers,
                     stroke,
                     stroke_paint,
                     fill_paint,
+                    shape_rendering,
                 };
                 draw_ctx.draw_shape(&view_params, &shape, node, acquired_nodes, values, clipping)
             }


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