From e5e30daf905fc6d41caa3c50d78ebc66b9e70c05 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Tue, 29 Dec 2015 18:17:06 +0100 Subject: Try to sort out 0-length path segments Change-Id: Icaf05be1675850e9b0ff233be0cc4cb5bf86ca6a --- src/lib/VSDContentCollector.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp index da6b073..c20e626 100644 --- a/src/lib/VSDContentCollector.cpp +++ b/src/lib/VSDContentCollector.cpp @@ -481,8 +481,28 @@ void libvisio::VSDContentCollector::_convertToPath(const std::vectorgetDouble(); + y = segmentVector[i]["svg:y"]->getDouble(); + } + // skip segment that have length 0.0 + if (!VSD_ALMOST_ZERO(x-prevX) || !VSD_ALMOST_ZERO(y-prevY)) + { + path.append(segmentVector[i]); + prevX = x; + prevY = y; + } + } } } -- cgit v1.2.3