[librsvg/attribute-parsers-737: 24/26] filters/convolve_matrix.rs: use set_attribute()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/attribute-parsers-737: 24/26] filters/convolve_matrix.rs: use set_attribute()
- Date: Fri, 21 Oct 2022 01:06:08 +0000 (UTC)
commit 9f871ec59ddef259d140fad4b9aefba5841686b5
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Oct 20 19:39:12 2022 -0500
filters/convolve_matrix.rs: use set_attribute()
I'll deal with the attributes that use NumberOptionalNumber later.
src/filters/convolve_matrix.rs | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/src/filters/convolve_matrix.rs b/src/filters/convolve_matrix.rs
index ec508cdc0..5089bb41a 100644
--- a/src/filters/convolve_matrix.rs
+++ b/src/filters/convolve_matrix.rs
@@ -4,7 +4,7 @@ use nalgebra::{DMatrix, Dynamic, VecStorage};
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::{NonNegative, NumberList, NumberOptionalNumber, Parse, ParseValue};
@@ -79,17 +79,27 @@ impl SetAttributes for FeConvolveMatrix {
let NumberOptionalNumber(x, y) = attr.parse(value)?;
self.params.order = (x, y);
}
- expanded_name!("", "divisor") => self.params.divisor = attr.parse(value)?,
- expanded_name!("", "bias") => self.params.bias = attr.parse(value)?,
- expanded_name!("", "targetX") => self.params.target_x = attr.parse(value)?,
- expanded_name!("", "targetY") => self.params.target_y = attr.parse(value)?,
- expanded_name!("", "edgeMode") => self.params.edge_mode = attr.parse(value)?,
+ expanded_name!("", "divisor") => {
+ set_attribute(&mut self.params.divisor, attr.parse(value), session)
+ }
+ expanded_name!("", "bias") => {
+ set_attribute(&mut self.params.bias, attr.parse(value), session)
+ }
+ expanded_name!("", "targetX") => {
+ set_attribute(&mut self.params.target_x, attr.parse(value), session)
+ }
+ expanded_name!("", "targetY") => {
+ set_attribute(&mut self.params.target_y, attr.parse(value), session)
+ }
+ expanded_name!("", "edgeMode") => {
+ set_attribute(&mut self.params.edge_mode, attr.parse(value), session)
+ }
expanded_name!("", "kernelUnitLength") => {
let NumberOptionalNumber(NonNegative(x), NonNegative(y)) = attr.parse(value)?;
self.params.kernel_unit_length = Some((x, y))
}
expanded_name!("", "preserveAlpha") => {
- self.params.preserve_alpha = attr.parse(value)?
+ set_attribute(&mut self.params.preserve_alpha, attr.parse(value), session);
}
_ => (),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]