[librsvg] image: reduce scope of cairo context
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] image: reduce scope of cairo context
- Date: Mon, 30 Dec 2019 18:57:05 +0000 (UTC)
commit 1b1cc4d9c942f5fd7e0f067df5e74125ee6afef6
Author: Paolo Borelli <pborelli gnome org>
Date: Mon Dec 30 19:35:31 2019 +0100
image: reduce scope of cairo context
rsvg_internals/src/image.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/rsvg_internals/src/image.rs b/rsvg_internals/src/image.rs
index 514f36fb..7eb25be4 100644
--- a/rsvg_internals/src/image.rs
+++ b/rsvg_internals/src/image.rs
@@ -104,8 +104,6 @@ impl NodeTrait for Image {
let bbox = dc.empty_bbox().with_rect(rect);
dc.with_saved_cr(&mut |dc| {
- let cr = dc.get_cairo_context();
-
let image_width = f64::from(image_width);
let image_height = f64::from(image_height);
@@ -115,6 +113,8 @@ impl NodeTrait for Image {
self.aspect,
clip_mode,
) {
+ let cr = dc.get_cairo_context();
+
// We need to set extend appropriately, so can't use cr.set_source_surface().
//
// If extend is left at its default value (None), then bilinear scaling uses
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]