[Libreoffice-commits] libvisio.git: src/lib

David Tardon dtardon at redhat.com
Mon Mar 12 12:43:37 UTC 2018


 src/lib/VSDContentCollector.cpp |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit f85c44b280a57cc273217c8385dd95a4989bd827
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Mar 12 13:32:53 2018 +0100

    speed up angle normalization
    
    Change-Id: I2531cae69ef9a64d5004692919bdcd96a069e994

diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp
index 9b4b39e..25907eb 100644
--- a/src/lib/VSDContentCollector.cpp
+++ b/src/lib/VSDContentCollector.cpp
@@ -638,9 +638,8 @@ void libvisio::VSDContentCollector::_flushText()
   if (flipX)
     angle -= M_PI;
 
-  while (angle > M_PI)
-    angle -= 2 * M_PI;
-  while (angle < -M_PI)
+  angle = std::fmod(angle, 2 * M_PI);
+  if (angle < 0)
     angle += 2 * M_PI;
 
   textBlockProps.insert("svg:x", m_scale * x);


More information about the Libreoffice-commits mailing list