[librsvg: 23/38] Make another call to push_view_box(1.0, 1.0) consistent
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 23/38] Make another call to push_view_box(1.0, 1.0) consistent
- Date: Tue, 29 Sep 2020 23:37:21 +0000 (UTC)
commit 1761289ebdab500fd691517b9de7f8b49db84fa2
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Sep 22 14:16:10 2020 -0500
Make another call to push_view_box(1.0, 1.0) consistent
rsvg_internals/src/drawing_ctx.rs | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index 870f14ca..2144f46b 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -1061,16 +1061,20 @@ impl DrawingCtx {
caffine = Transform::new_scale(sw, sh).pre_translate(x, y);
self.push_view_box(vbox.width(), vbox.height())
- } else if content_units == PatternContentUnits(CoordUnits::ObjectBoundingBox) {
- // If coords are in terms of the bounding box, use them
- let (bbw, bbh) = bbox.rect.unwrap().size();
-
- caffine = Transform::new_scale(bbw, bbh);
-
- self.push_view_box(1.0, 1.0)
} else {
- caffine = Transform::identity();
- self.get_view_params()
+ caffine = if content_units == PatternContentUnits(CoordUnits::ObjectBoundingBox) {
+ // If coords are in terms of the bounding box, use them
+ let (bbw, bbh) = bbox.rect.unwrap().size();
+ Transform::new_scale(bbw, bbh)
+ } else {
+ Transform::identity()
+ };
+
+ if content_units == PatternContentUnits(CoordUnits::ObjectBoundingBox) {
+ self.push_view_box(1.0, 1.0)
+ } else {
+ self.get_view_params()
+ }
};
if !scwscale.approx_eq_cairo(1.0) || !schscale.approx_eq_cairo(1.0) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]