[librsvg: 5/45] RadialGradient: resolved version of RadialGradientData
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 5/45] RadialGradient: resolved version of RadialGradientData
- Date: Tue, 1 Oct 2019 15:07:21 +0000 (UTC)
commit 4d91da66fa59a9dcfb4ef7e2aed1c7c4f7e36d33
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Sep 26 17:31:23 2019 -0500
RadialGradient: resolved version of RadialGradientData
rsvg_internals/src/gradient.rs | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
---
diff --git a/rsvg_internals/src/gradient.rs b/rsvg_internals/src/gradient.rs
index fdab0532..799b6814 100644
--- a/rsvg_internals/src/gradient.rs
+++ b/rsvg_internals/src/gradient.rs
@@ -364,6 +364,14 @@ pub struct RadialGradientData {
fy: Option<LengthVertical>,
}
+pub struct RadialGradient {
+ cx: LengthHorizontal,
+ cy: LengthVertical,
+ r: LengthBoth,
+ fx: LengthHorizontal,
+ fy: LengthVertical,
+}
+
impl Resolve for RadialGradientData {
fn is_resolved(&self) -> bool {
self.cx.is_some()
@@ -409,6 +417,20 @@ impl RadialGradientData {
Ok(())
}
+ fn to_resolved(self) -> RadialGradient {
+ assert!(self.is_resolved());
+
+ let RadialGradientData { cx, cy, r, fx, fy } = self;
+
+ RadialGradient {
+ cx: cx.unwrap(),
+ cy: cy.unwrap(),
+ r: r.unwrap(),
+ fx: fx.unwrap(),
+ fy: fy.unwrap(),
+ }
+ }
+
fn to_cairo_gradient(
&self,
values: &ComputedValues,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]