[librsvg] viewport.rs: Make the order of operations consistent
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] viewport.rs: Make the order of operations consistent
- Date: Thu, 28 Sep 2017 22:40:32 +0000 (UTC)
commit e9cd4983e2197e8fdefefbe30b5e2c9903903359
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Sep 28 09:05:28 2017 -0500
viewport.rs: Make the order of operations consistent
rust/src/viewport.rs | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/rust/src/viewport.rs b/rust/src/viewport.rs
index 2e37856..394323d 100644
--- a/rust/src/viewport.rs
+++ b/rust/src/viewport.rs
@@ -103,6 +103,10 @@ fn in_viewport<F>(ctx: &mut ViewportCtx,
// https://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute
return;
}
+
+ ctx.push_view_box(vbox.0.width, vbox.0.height);
+ ctx.push_discrete_layer();
+
let (x, y, w, h) = preserve_aspect_ratio.compute(vbox.0.width, vbox.0.height,
vx, vy, vw, vh);
@@ -112,19 +116,15 @@ fn in_viewport<F>(ctx: &mut ViewportCtx,
ctx.set_affine(affine);
- ctx.push_view_box(vbox.0.width, vbox.0.height);
-
- ctx.push_discrete_layer();
-
if do_clip && clip_mode == ClipMode::ClipToVbox {
ctx.add_clipping_rect(vbox.0.x, vbox.0.y, vbox.0.width, vbox.0.height);
}
} else {
- affine.translate(vx, vy);
- ctx.set_affine(affine);
-
ctx.push_view_box(vw, vh);
ctx.push_discrete_layer();
+
+ affine.translate(vx, vy);
+ ctx.set_affine(affine);
}
if do_clip && clip_mode == ClipMode::ClipToViewport {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]