[librsvg/librsvg-2.46] text: code cleanup
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.46] text: code cleanup
- Date: Tue, 15 Oct 2019 16:45:05 +0000 (UTC)
commit 94fcc7f65c90f6a004c38f8bdeca6c03eff039ce
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Oct 13 12:20:47 2019 +0200
text: code cleanup
rsvg_internals/src/text.rs | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/rsvg_internals/src/text.rs b/rsvg_internals/src/text.rs
index 5f8cece8..a3aaabbd 100644
--- a/rsvg_internals/src/text.rs
+++ b/rsvg_internals/src/text.rs
@@ -272,7 +272,11 @@ impl PositionedSpan {
}
}
- fn draw(&self, draw_ctx: &mut DrawingCtx, clipping: bool) -> Result<BoundingBox, RenderingError> {
+ fn draw(
+ &self,
+ draw_ctx: &mut DrawingCtx,
+ clipping: bool,
+ ) -> Result<BoundingBox, RenderingError> {
draw_ctx.with_saved_cr(&mut |dc| {
let cr = dc.get_cairo_context();
@@ -340,17 +344,14 @@ impl PositionedSpan {
Ok(())
};
- if res.is_ok() {
- if need_layout_path {
- pangocairo::functions::update_layout(&cr, &self.layout);
- pangocairo::functions::layout_path(&cr, &self.layout);
+ if res.is_ok() && need_layout_path {
+ pangocairo::functions::update_layout(&cr, &self.layout);
+ pangocairo::functions::layout_path(&cr, &self.layout);
- if !clipping {
- let ib =
- BoundingBox::new(&affine).with_ink_extents(cr.stroke_extents());
- cr.stroke();
- bbox.insert(&ib);
- }
+ if !clipping {
+ let ib = BoundingBox::new(&affine).with_ink_extents(cr.stroke_extents());
+ cr.stroke();
+ bbox.insert(&ib);
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]