vcl/source/outdev/textline.cxx |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 66df55d80034e924d6ca6c05b576e417873f358c
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Sep 15 12:11:23 2021 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Wed Sep 15 16:36:49 2021 +0200

    No need to check for x = 0 in atan2 here
    
    The guarantee is that either x or y argument is non-0.
    It was this way ever since "initial import" commit
    8ab086b6cc054501bfbf7ef6fa509c393691e860.
    
    Change-Id: I2f5ccbbc9a4f00aafef151ef3dd008eddeef0e78
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122114
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index b7445b4b825e..2e8edc42f329 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -1002,8 +1002,7 @@ void OutputDevice::DrawWaveLine(const Point& rStartPos, 
const Point& rEndPos, to
     // handle rotation
     if (nStartY != nEndY || nStartX > nEndX)
     {
-        tools::Long nLengthX = nEndX - nStartX;
-        fOrientation = std::atan2(nStartY - nEndY, (nLengthX == 0 ? 
0.000000001 : nLengthX));
+        fOrientation = std::atan2(nStartY - nEndY, nEndX - nStartX);
         fOrientation /= F_PI180;
         // un-rotate the end point
         aStartPt.RotateAround(nEndX, nEndY, 
Degree10(static_cast<sal_Int16>(-fOrientation * 10.0)));

Reply via email to