[librsvg] image: do not compute bbox if we are returning early
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] image: do not compute bbox if we are returning early
- Date: Mon, 31 Dec 2018 23:54:45 +0000 (UTC)
commit 45301442002dcd9bd9cec256f02aba13ea27b858
Author: Paolo Borelli <pborelli gnome org>
Date: Mon Dec 31 17:28:41 2018 +0100
image: do not compute bbox if we are returning early
rsvg_internals/src/image.rs | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/rsvg_internals/src/image.rs b/rsvg_internals/src/image.rs
index faf1cdbd..422ed32a 100644
--- a/rsvg_internals/src/image.rs
+++ b/rsvg_internals/src/image.rs
@@ -123,6 +123,12 @@ impl NodeTrait for NodeImage {
dc.clip(x, y, w, h);
}
+ let width = surface.get_width();
+ let height = surface.get_height();
+ if clipping || width == 0 || height == 0 {
+ return Ok(());
+ }
+
// The bounding box for <image> is decided by the values of x, y, w, h and not by
// the final computed image bounds.
let bbox = BoundingBox::new(&dc.get_cairo_context().get_matrix()).with_rect(Some(
@@ -134,12 +140,6 @@ impl NodeTrait for NodeImage {
},
));
- let width = surface.get_width();
- let height = surface.get_height();
- if clipping || width == 0 || height == 0 {
- return Ok(());
- }
-
let width = f64::from(width);
let height = f64::from(height);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]