[librsvg: 4/27] Filter::to_user_space - take a NormalizeParams
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 4/27] Filter::to_user_space - take a NormalizeParams
- Date: Mon, 10 May 2021 16:06:42 +0000 (UTC)
commit ad95bf925c81e5e4bdb6eec98079e9a602139624
Author: Federico Mena Quintero <federico gnome org>
Date: Fri May 7 19:26:17 2021 -0500
Filter::to_user_space - take a NormalizeParams
src/filter.rs | 12 ++++++------
src/filter_func.rs | 3 ++-
src/filters/mod.rs | 2 +-
3 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/src/filter.rs b/src/filter.rs
index 9bb0b1ec..72a10624 100644
--- a/src/filter.rs
+++ b/src/filter.rs
@@ -6,7 +6,7 @@ use std::slice::Iter;
use crate::coord_units::CoordUnits;
use crate::document::{AcquiredNodes, NodeId};
-use crate::drawing_ctx::{DrawingCtx, ViewParams};
+use crate::drawing_ctx::DrawingCtx;
use crate::element::{Draw, Element, ElementResult, SetAttributes};
use crate::error::ValueErrorKind;
use crate::filter_func::FilterFunction;
@@ -58,11 +58,11 @@ impl Filter {
self.primitive_units
}
- pub fn to_user_space(&self, values: &ComputedValues, params: &ViewParams) -> UserSpaceFilter {
- let x = self.x.normalize(values, ¶ms);
- let y = self.y.normalize(values, ¶ms);
- let w = self.width.normalize(values, ¶ms);
- let h = self.height.normalize(values, ¶ms);
+ pub fn to_user_space(&self, params: &NormalizeParams) -> UserSpaceFilter {
+ let x = self.x.to_user(params);
+ let y = self.y.to_user(params);
+ let w = self.width.to_user(params);
+ let h = self.height.to_user(params);
let rect = Rect::new(x, y, x + w, y + h);
diff --git a/src/filter_func.rs b/src/filter_func.rs
index 1698043b..8039ba26 100644
--- a/src/filter_func.rs
+++ b/src/filter_func.rs
@@ -63,7 +63,8 @@ impl Blur {
.map(|l| l.normalize(values, params))
.unwrap_or(0.0);
- let user_space_filter = Filter::default().to_user_space(values, params);
+ let user_space_filter =
+ Filter::default().to_user_space(&NormalizeParams::new(values, params));
let gaussian_blur = ResolvedPrimitive {
primitive: Primitive::default(),
diff --git a/src/filters/mod.rs b/src/filters/mod.rs
index 393d2a8e..6dc885f7 100644
--- a/src/filters/mod.rs
+++ b/src/filters/mod.rs
@@ -264,7 +264,7 @@ pub fn extract_filter_from_filter_node(
// This is in a temporary scope so we don't leave the coord_units pushed during
// the execution of all the filter primitives.
let params = draw_ctx.push_coord_units(filter.get_filter_units());
- filter.to_user_space(filter_values, ¶ms)
+ filter.to_user_space(&NormalizeParams::new(filter_values, ¶ms))
};
let primitives = filter_node
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]