[librsvg: 27/45] Remove NodeStop.get_offset(); access the field directly
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 27/45] Remove NodeStop.get_offset(); access the field directly
- Date: Tue, 1 Oct 2019 15:09:12 +0000 (UTC)
commit c9bf7461cf300bfdc624d6b9c8258ab4c3d381d7
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Sep 30 07:22:01 2019 -0500
Remove NodeStop.get_offset(); access the field directly
It's only done in a a single place.
rsvg_internals/src/gradient.rs | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
---
diff --git a/rsvg_internals/src/gradient.rs b/rsvg_internals/src/gradient.rs
index 197d169c..8e01adb5 100644
--- a/rsvg_internals/src/gradient.rs
+++ b/rsvg_internals/src/gradient.rs
@@ -123,12 +123,6 @@ pub struct NodeStop {
offset: UnitInterval,
}
-impl NodeStop {
- pub fn get_offset(&self) -> UnitInterval {
- self.offset
- }
-}
-
fn validate_offset(length: LengthBoth) -> Result<LengthBoth, ValueErrorKind> {
match length.unit() {
LengthUnit::Px | LengthUnit::Percent => Ok(length),
@@ -468,7 +462,6 @@ impl UnresolvedGradient {
if child.is_in_error() {
rsvg_log!("(not using gradient stop {} because it is in error)", child);
} else {
- let offset = stop.get_offset();
let cascaded = CascadedValues::new_from_node(&child_node);
let values = cascaded.get();
let rgba = match values.stop_color {
@@ -476,7 +469,7 @@ impl UnresolvedGradient {
StopColor(cssparser::Color::RGBA(ref rgba)) => *rgba,
};
- self.add_color_stop(offset, rgba, values.stop_opacity.0);
+ self.add_color_stop(stop.offset, rgba, values.stop_opacity.0);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]