summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorHideki Ikeda <hideki.ikeda@gmail.com>2014-06-24 19:05:51 -0400
committerCaolán McNamara <caolanm@redhat.com>2014-06-25 13:15:26 +0100
commit390dc4eb87637c99be37f29c630618c13ea1d0a0 (patch)
tree58e5b8be9a610548e648e5b687ad2df760f181f6 /svx
parentccace9b443e419c59274c8794eb3a9973c20b61f (diff)
fdo#37401 - fixed the old vector length
The center-left point in the area is used to calculate the old vector length but the coordinate was incorrect. Change-Id: I81a88182d11e30ee7a5caee3eac879b082bff160 Reviewed-on: https://gerrit.libreoffice.org/9887 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 03675ab4a8994cb7000fd738d1685720c8b9e584) Related: fdo#37401 adjust fix to original aCenter use i.e. as far as I can see the bug came about during.... commit 74cb1c4cb5f72fd8cf80c6d144eda00841394647 Author: Ivo Hinkelmann <ihi@openoffice.org> Date: Tue Nov 14 12:37:46 2006 +0000 with 2006/10/27 12:14:08 aw 1.2.1208.5: #i39528# ::basegfx -> basegfx adaption in - Vector2D aFullVec(aStartPos - aEndPos); - Vector2D aOldVec(Vector2D(aRect.Left(), aCenter.Y()) - aRect.TopLeft()); ^^^^^^^^^^^ - double fFullLen = aFullVec.GetLength(); - double fOldLen = aOldVec.GetLength(); - double fNewBorder = (fFullLen * 100.0) / fOldLen; - sal_Int32 nNewBorder = 100 - (sal_Int32)(fNewBorder + 0.5); + basegfx::B2DVector aFullVec(aStartPos - aEndPos); + const basegfx::B2DPoint aTopLeft(aRange.getMinX(), aRange.getMinY()); + const basegfx::B2DPoint aCenterLeft(aRange.getMinX(), aRange.getHeight()); ^^^^^^^^^^^^^^^^^^ + const basegfx::B2DVector aOldVec(aCenterLeft - aTopLeft); + const double fFullLen(aFullVec.getLength()); + const double fOldLen(aOldVec.getLength()); + const double fNewBorder((fFullLen * 100.0) / fOldLen); + sal_Int32 nNewBorder(100L - FRound(fNewBorder)); Change-Id: I840caa5e49a04f9b6460c4fa8e3731f3e5ebde05 (cherry picked from commit ef16d765306c932c49254f295f57e5853129c1ea) (cherry picked from commit 383135d77867d0f2c05b4c807eb17b099604eaa1)
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/gradtrns.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/svx/source/svdraw/gradtrns.cxx b/svx/source/svdraw/gradtrns.cxx
index f0bdfeb24525..be875b250008 100644
--- a/svx/source/svdraw/gradtrns.cxx
+++ b/svx/source/svdraw/gradtrns.cxx
@@ -468,7 +468,7 @@ void GradTransformer::VecToGrad(GradTransVector& rV, GradTransGradient& rG, Grad
{
basegfx::B2DVector aFullVec(aStartPos - aEndPos);
const basegfx::B2DPoint aTopLeft(aRange.getMinX(), aRange.getMinY());
- const basegfx::B2DPoint aCenterLeft(aRange.getMinX(), aRange.getHeight());
+ const basegfx::B2DPoint aCenterLeft(aRange.getMinX(), aCenter.getY());
const basegfx::B2DVector aOldVec(aCenterLeft - aTopLeft);
const double fFullLen(aFullVec.getLength());
const double fOldLen(aOldVec.getLength());