[librsvg: 6/15] Filter: rename a couple of fields
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 6/15] Filter: rename a couple of fields
- Date: Thu, 8 Apr 2021 22:52:27 +0000 (UTC)
commit 83f2c5d5b94c7c049cf047635bbc52c34ad7d954
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Apr 8 12:17:22 2021 -0500
Filter: rename a couple of fields
icantreadthis -> i_can_read_this
src/filter.rs | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/filter.rs b/src/filter.rs
index 6da09dd0..7ea31c81 100644
--- a/src/filter.rs
+++ b/src/filter.rs
@@ -22,8 +22,8 @@ pub struct Filter {
y: Length<Vertical>,
width: ULength<Horizontal>,
height: ULength<Vertical>,
- filterunits: CoordUnits,
- primitiveunits: CoordUnits,
+ filter_units: CoordUnits,
+ primitive_units: CoordUnits,
}
impl Default for Filter {
@@ -34,25 +34,25 @@ impl Default for Filter {
y: Length::<Vertical>::parse_str("-10%").unwrap(),
width: ULength::<Horizontal>::parse_str("120%").unwrap(),
height: ULength::<Vertical>::parse_str("120%").unwrap(),
- filterunits: CoordUnits::ObjectBoundingBox,
- primitiveunits: CoordUnits::UserSpaceOnUse,
+ filter_units: CoordUnits::ObjectBoundingBox,
+ primitive_units: CoordUnits::UserSpaceOnUse,
}
}
}
impl Filter {
pub fn get_filter_units(&self) -> CoordUnits {
- self.filterunits
+ self.filter_units
}
pub fn get_primitive_units(&self) -> CoordUnits {
- self.primitiveunits
+ self.primitive_units
}
pub fn get_rect(&self, values: &ComputedValues, params: &ViewParams) -> Rect {
// With filterunits == ObjectBoundingBox, lengths represent fractions or percentages of the
// referencing node. No units are allowed (it's checked during attribute parsing).
- let (x, y, w, h) = if self.filterunits == CoordUnits::ObjectBoundingBox {
+ let (x, y, w, h) = if self.filter_units == CoordUnits::ObjectBoundingBox {
(
self.x.length,
self.y.length,
@@ -80,11 +80,11 @@ impl SetAttributes for Filter {
.find(|(attr, _)| attr.expanded() == expanded_name!("", "filterUnits"))
.and_then(|(attr, value)| attr.parse(value).ok());
if let Some(filter_units) = result {
- self.filterunits = filter_units
+ self.filter_units = filter_units
}
// With ObjectBoundingBox, only fractions and percents are allowed.
- let units_allowed = self.filterunits != CoordUnits::ObjectBoundingBox;
+ let units_allowed = self.filter_units != CoordUnits::ObjectBoundingBox;
// Parse the rest of the attributes.
for (attr, value) in attrs.iter() {
@@ -109,7 +109,7 @@ impl SetAttributes for Filter {
.parse(value)
.and_then(|v| check_units(v, units_allowed, attr))?
}
- expanded_name!("", "primitiveUnits") => self.primitiveunits = attr.parse(value)?,
+ expanded_name!("", "primitiveUnits") => self.primitive_units = attr.parse(value)?,
_ => (),
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]