From 3660bcf30d7a02bc71251e4a4a5c5d89025d20ca Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 5 Apr 2010 09:20:59 +0000 Subject: [PATCH] adjust the width/height by the offset, don't calculte another offset that is plain wrong svn path=/trunk/KDE/kdelibs/; revision=1111250 --- svg.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/svg.cpp b/svg.cpp index ba3225446..6d2d1b05e 100644 --- a/svg.cpp +++ b/svg.cpp @@ -418,6 +418,7 @@ class SvgPrivate qreal rem_dst = dst.x() - (floor(dst.x())); qreal offset = closestDistance(rem_dst, rem_orig); res.translate(offset + offset*div_w, 0); + res.setWidth(res.width() + offset); } //vertical snap if (!qFuzzyIsNull(div_y) && !qFuzzyCompare(div_h, div_y)) { @@ -425,19 +426,6 @@ class SvgPrivate qreal rem_dst = dst.y() - (floor(dst.y())); qreal offset = closestDistance(rem_dst, rem_orig); res.translate(0, offset + offset*div_h); - } - - if (!qFuzzyIsNull(div_w)) { - qreal rem_orig = orig.width() - (floor(orig.width())); - qreal rem_dst = dst.width() - (floor(dst.width())); - qreal offset = closestDistance(rem_dst, rem_orig); - res.setWidth(res.width() + offset); - } - - if (!qFuzzyIsNull(div_h)) { - qreal rem_orig = orig.height() - (floor(orig.height())); - qreal rem_dst = dst.height() - (floor(dst.height())); - qreal offset = closestDistance(rem_dst, rem_orig); res.setHeight(res.height() + offset); }