[librsvg] image: shorten code
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] image: shorten code
- Date: Mon, 30 Dec 2019 18:57:15 +0000 (UTC)
commit 3eef7495958e3ba5fafe1d6ab96b8e6ebf9365a1
Author: Paolo Borelli <pborelli gnome org>
Date: Mon Dec 30 19:53:14 2019 +0100
image: shorten code
rsvg_internals/src/image.rs | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/rsvg_internals/src/image.rs b/rsvg_internals/src/image.rs
index 7eb25be4..1dbf3f6a 100644
--- a/rsvg_internals/src/image.rs
+++ b/rsvg_internals/src/image.rs
@@ -106,13 +106,11 @@ impl NodeTrait for Image {
dc.with_saved_cr(&mut |dc| {
let image_width = f64::from(image_width);
let image_height = f64::from(image_height);
+ let vbox = ViewBox(Rect::from_size(image_width, image_height));
- if let Some(_params) = dc.push_new_viewport(
- Some(ViewBox(Rect::from_size(image_width, image_height))),
- Rect::new(x, y, x + w, y + h),
- self.aspect,
- clip_mode,
- ) {
+ if let Some(_params) =
+ dc.push_new_viewport(Some(vbox), rect, self.aspect, clip_mode)
+ {
let cr = dc.get_cairo_context();
// We need to set extend appropriately, so can't use cr.set_source_surface().
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]