[librsvg: 11/14] DrawingCtx.set_color never fails; don't return Result
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 11/14] DrawingCtx.set_color never fails; don't return Result
- Date: Tue, 23 Mar 2021 19:57:56 +0000 (UTC)
commit ce49ed89976712674b23ba0e72f3158241e30eb5
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Mar 23 13:20:20 2021 -0600
DrawingCtx.set_color never fails; don't return Result
src/drawing_ctx.rs | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index 99d07188..0526b7c6 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -1098,15 +1098,13 @@ impl DrawingCtx {
Ok(true)
}
- fn set_color(&self, rgba: cssparser::RGBA) -> Result<bool, RenderingError> {
+ fn set_color(&self, rgba: cssparser::RGBA) {
self.cr.clone().set_source_rgba(
f64::from(rgba.red_f32()),
f64::from(rgba.green_f32()),
f64::from(rgba.blue_f32()),
f64::from(rgba.alpha_f32()),
);
-
- Ok(true)
}
fn set_paint_source(
@@ -1119,7 +1117,8 @@ impl DrawingCtx {
if self.set_gradient(gradient)? {
Ok(true)
} else if let Some(c) = c {
- self.set_color(c)
+ self.set_color(c);
+ Ok(true)
} else {
Ok(false)
}
@@ -1128,12 +1127,16 @@ impl DrawingCtx {
if self.set_pattern(pattern, acquired_nodes)? {
Ok(true)
} else if let Some(c) = c {
- self.set_color(c)
+ self.set_color(c);
+ Ok(true)
} else {
Ok(false)
}
}
- UserSpacePaintSource::SolidColor(c) => self.set_color(c),
+ UserSpacePaintSource::SolidColor(c) => {
+ self.set_color(c);
+ Ok(true)
+ },
UserSpacePaintSource::None => Ok(false),
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]