[librsvg: 5/11] Rename Gradient to UserSpaceGradient
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 5/11] Rename Gradient to UserSpaceGradient
- Date: Tue, 1 Dec 2020 18:24:44 +0000 (UTC)
commit 644e4bf47ba55bf4f06d1400d9d40a44052fd7e2
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Dec 1 10:08:15 2020 -0600
Rename Gradient to UserSpaceGradient
I'm going to apply the same treatment to have a UserSpacePattern.
However, *that* one cannot be called Pattern because "struct Pattern"
is already for the <pattern> element. Gradients don't have this name
collision because their elements are called <linearGradient> and
<radialGradient>.
src/drawing_ctx.rs | 4 ++--
src/gradient.rs | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index 19e2dc6d..7aa0e02e 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -20,7 +20,7 @@ use crate::error::{AcquireError, RenderingError};
use crate::filter::FilterValue;
use crate::filters;
use crate::float_eq_cairo::ApproxEqCairo;
-use crate::gradient::{Gradient, GradientVariant, SpreadMethod};
+use crate::gradient::{GradientVariant, SpreadMethod, UserSpaceGradient};
use crate::marker;
use crate::node::{CascadedValues, Node, NodeBorrow, NodeDraw};
use crate::paint_server::{PaintServer, PaintSource};
@@ -933,7 +933,7 @@ impl DrawingCtx {
Ok(child_surface)
}
- fn set_gradient(self: &mut DrawingCtx, gradient: &Gradient, opacity: UnitInterval) {
+ fn set_gradient(self: &mut DrawingCtx, gradient: &UserSpaceGradient, opacity: UnitInterval) {
let g = match gradient.variant {
GradientVariant::Linear { x1, y1, x2, y2 } => {
cairo::Gradient::clone(&cairo::LinearGradient::new(x1, y1, x2, y2))
diff --git a/src/gradient.rs b/src/gradient.rs
index b3dc6dd0..96101878 100644
--- a/src/gradient.rs
+++ b/src/gradient.rs
@@ -364,7 +364,7 @@ pub struct ResolvedGradient {
}
/// Gradient normalized to user-space units.
-pub struct Gradient {
+pub struct UserSpaceGradient {
pub transform: Transform,
pub spread: SpreadMethod,
pub stops: Vec<ColorStop>,
@@ -700,7 +700,7 @@ impl ResolvedGradient {
bbox: &BoundingBox,
draw_ctx: &DrawingCtx,
values: &ComputedValues,
- ) -> Option<Gradient> {
+ ) -> Option<UserSpaceGradient> {
let units = self.units.0;
let transform = if let Ok(t) = bbox.rect_to_transform(units) {
t
@@ -741,7 +741,7 @@ impl ResolvedGradient {
},
};
- Some(Gradient {
+ Some(UserSpaceGradient {
transform,
spread: self.spread,
stops: self.stops.clone(),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]