From 89b3aad0f6a1db084e908fad78666aaa64278053 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 13 Jun 2018 12:20:18 +0300 Subject: Fix bbox computation in draw_surface() --- rsvg_internals/src/draw.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rsvg_internals/src/draw.rs b/rsvg_internals/src/draw.rs index 7d5417f9..796da292 100644 --- a/rsvg_internals/src/draw.rs +++ b/rsvg_internals/src/draw.rs @@ -461,13 +461,13 @@ pub fn draw_surface( let width = f64::from(width); let height = f64::from(height); - let mut bbox = BoundingBox::new(&affine); - bbox.rect = Some(cairo::Rectangle { + // This is the target bbox after drawing. + let bbox = BoundingBox::new(&affine).with_rect(Some(cairo::Rectangle { x, y, - width, - height, - }); + width: w, + height: h, + })); set_affine_on_cr(draw_ctx, &cr); cr.scale(w / width, h / height); -- cgit v1.2.1