[librsvg/librsvg-2.50] push_coord_units: Always push a Viewport, instead of sometimes returning a copy of the last one
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.50] push_coord_units: Always push a Viewport, instead of sometimes returning a copy of the last one
- Date: Fri, 2 Oct 2020 19:24:37 +0000 (UTC)
commit b700ad1941238044ea411a29732cd3ea46492be9
Author: Federico Mena Quintero <federico gnome org>
Date: Mon Sep 28 16:19:01 2020 -0500
push_coord_units: Always push a Viewport, instead of sometimes returning a copy of the last one
rsvg_internals/src/drawing_ctx.rs | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index 7f78aaf2..b7ded244 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -308,10 +308,14 @@ impl DrawingCtx {
}
pub fn push_coord_units(&self, units: CoordUnits) -> ViewParams {
- if units == CoordUnits::ObjectBoundingBox {
- self.push_view_box(1.0, 1.0)
- } else {
- self.get_view_params()
+ match units {
+ CoordUnits::ObjectBoundingBox => self.push_view_box(1.0, 1.0),
+
+ CoordUnits::UserSpaceOnUse => {
+ // Duplicate the topmost viewport;
+ let viewport = self.get_top_viewport();
+ self.push_viewport(viewport)
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]