[librsvg/attribute-parsers-737: 26/26] filters/displacement_map.rs: use set_attribute()




commit 8a54a3c33358d853a1ab797bc6c4bf7de9cc0c8d
Author: Federico Mena Quintero <federico gnome org>
Date:   Thu Oct 20 19:47:49 2022 -0500

    filters/displacement_map.rs: use set_attribute()

 src/filters/displacement_map.rs | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/src/filters/displacement_map.rs b/src/filters/displacement_map.rs
index c70804407..55e2c4e84 100644
--- a/src/filters/displacement_map.rs
+++ b/src/filters/displacement_map.rs
@@ -3,7 +3,7 @@ use markup5ever::{expanded_name, local_name, namespace_url, ns};
 
 use crate::document::AcquiredNodes;
 use crate::drawing_ctx::DrawingCtx;
-use crate::element::{ElementResult, SetAttributes};
+use crate::element::{set_attribute, ElementResult, SetAttributes};
 use crate::error::*;
 use crate::node::{CascadedValues, Node};
 use crate::parsers::{Parse, ParseValue};
@@ -57,12 +57,22 @@ impl SetAttributes for FeDisplacementMap {
 
         for (attr, value) in attrs.iter() {
             match attr.expanded() {
-                expanded_name!("", "scale") => self.params.scale = attr.parse(value)?,
+                expanded_name!("", "scale") => {
+                    set_attribute(&mut self.params.scale, attr.parse(value), session)
+                }
                 expanded_name!("", "xChannelSelector") => {
-                    self.params.x_channel_selector = attr.parse(value)?
+                    set_attribute(
+                        &mut self.params.x_channel_selector,
+                        attr.parse(value),
+                        session,
+                    );
                 }
                 expanded_name!("", "yChannelSelector") => {
-                    self.params.y_channel_selector = attr.parse(value)?
+                    set_attribute(
+                        &mut self.params.y_channel_selector,
+                        attr.parse(value),
+                        session,
+                    );
                 }
                 _ => (),
             }


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