[librsvg: 24/30] Handle cairo errors from fill() and stroke()
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 24/30] Handle cairo errors from fill() and stroke()
- Date: Wed, 23 Jun 2021 23:05:40 +0000 (UTC)
commit 92a9847c878f31630d6baf3b466107d71ebd3d24
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Jun 21 20:18:02 2021 -0500
Handle cairo errors from fill() and stroke()
Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/516>
src/drawing_ctx.rs | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/src/drawing_ctx.rs b/src/drawing_ctx.rs
index 4767727c..67114d35 100644
--- a/src/drawing_ctx.rs
+++ b/src/drawing_ctx.rs
@@ -1151,12 +1151,10 @@ impl DrawingCtx {
acquired_nodes: &mut AcquiredNodes<'_>,
paint_source: &UserSpacePaintSource,
) -> Result<(), RenderingError> {
- self.set_paint_source(paint_source, acquired_nodes)
- .map(|had_paint_server| {
- if had_paint_server {
- cr.stroke_preserve();
- }
- })?;
+ let had_paint_server = self.set_paint_source(paint_source, acquired_nodes)?;
+ if had_paint_server {
+ cr.stroke_preserve()?;
+ }
Ok(())
}
@@ -1167,12 +1165,10 @@ impl DrawingCtx {
acquired_nodes: &mut AcquiredNodes<'_>,
paint_source: &UserSpacePaintSource,
) -> Result<(), RenderingError> {
- self.set_paint_source(paint_source, acquired_nodes)
- .map(|had_paint_server| {
- if had_paint_server {
- cr.fill_preserve();
- }
- })?;
+ let had_paint_server = self.set_paint_source(paint_source, acquired_nodes)?;
+ if had_paint_server {
+ cr.fill_preserve()?;
+ }
Ok(())
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]