[librsvg: 26/31] Shape now has its PaintOrder




commit 6cd3fb69d956e3caeaefcc297822d2d8c22d3023
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Jun 2 20:19:12 2021 -0500

    Shape now has its PaintOrder

 src/drawing_ctx.rs | 2 +-
 src/shapes.rs      | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index a81c62f3..6edf90ed 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -1241,7 +1241,7 @@ impl DrawingCtx {
                 let fill_paint = shape.fill_paint.to_user_space(&bbox, view_params, values);
 
                 if values.is_visible() {
-                    for &target in &values.paint_order().targets {
+                    for &target in &shape.paint_order.targets {
                         // fill and stroke operations will preserve the path.
                         // markers operation will clear the path.
                         match target {
diff --git a/src/shapes.rs b/src/shapes.rs
index 23e4ec7d..336cf9d7 100644
--- a/src/shapes.rs
+++ b/src/shapes.rs
@@ -18,7 +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::{ClipRule, FillRule, ShapeRendering};
+use crate::property_defs::{ClipRule, FillRule, PaintOrder, ShapeRendering};
 use crate::xml::Attributes;
 
 #[derive(Copy, Clone, PartialEq)]
@@ -35,6 +35,7 @@ struct ShapeDef {
 pub struct Shape {
     pub path: Rc<SvgPath>,
     pub markers: Markers,
+    pub paint_order: PaintOrder,
     pub stroke: Stroke,
     pub stroke_paint: PaintSource,
     pub fill_paint: PaintSource,
@@ -69,6 +70,8 @@ macro_rules! impl_draw {
                 let params = NormalizeParams::new(values, &view_params);
                 let shape_def = self.make_shape(&params);
 
+                let paint_order = values.paint_order();
+
                 let stroke = Stroke::new(values, &params);
 
                 let stroke_paint = values.stroke().0.resolve(
@@ -90,6 +93,7 @@ macro_rules! impl_draw {
                 let shape = Shape {
                     path: shape_def.path,
                     markers: shape_def.markers,
+                    paint_order,
                     stroke,
                     stroke_paint,
                     fill_paint,


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