[librsvg: 24/27] Mask.get_rect: use NormalizeParams
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 24/27] Mask.get_rect: use NormalizeParams
- Date: Mon, 10 May 2021 16:06:43 +0000 (UTC)
commit 7b01fc5ed5022983b59686f96132b01a10fcdef4
Author: Federico Mena Quintero <federico gnome org>
Date: Mon May 10 10:23:47 2021 -0500
Mask.get_rect: use NormalizeParams
src/drawing_ctx.rs | 5 +++--
src/structure.rs | 11 +++++------
2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index c73afaf0..62e9028c 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -525,8 +525,9 @@ impl DrawingCtx {
let mask_units = mask.get_units();
let mask_rect = {
- let params = self.push_coord_units(mask_units);
- mask.get_rect(&values, ¶ms)
+ let view_params = self.push_coord_units(mask_units);
+ let params = NormalizeParams::new(values, &view_params);
+ mask.get_rect(¶ms)
};
let mask_transform = mask_node
diff --git a/src/structure.rs b/src/structure.rs
index fd3a02be..e92801e1 100644
--- a/src/structure.rs
+++ b/src/structure.rs
@@ -13,7 +13,6 @@ use crate::href::{is_href, set_href};
use crate::length::*;
use crate::node::{CascadedValues, Node, NodeBorrow, NodeDraw};
use crate::parsers::{Parse, ParseValue};
-use crate::properties::ComputedValues;
use crate::rect::Rect;
use crate::viewbox::*;
use crate::xml::Attributes;
@@ -415,11 +414,11 @@ impl Mask {
CoordUnits::from(self.content_units)
}
- pub fn get_rect(&self, values: &ComputedValues, params: &ViewParams) -> Rect {
- 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 get_rect(&self, params: &NormalizeParams) -> Rect {
+ 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);
Rect::new(x, y, x + w, y + h)
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]