summaryrefslogtreecommitdiff
path: root/src/lib/VSDContentCollector.cpp
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2015-12-29 16:29:36 +0100
committerFridrich Štrba <fridrich.strba@bluewin.ch>2015-12-29 16:29:36 +0100
commit53f7dacb2869feaa959f56a701f123839fbb8a80 (patch)
treeec1bb8ec4e27541f0001d28f51eaebfd95f7077c /src/lib/VSDContentCollector.cpp
parentd62d8b5f13b31b55706ad35fe69a871847a163e1 (diff)
Avoid equality comparison of doubles, which is prone to rounding errors
Change-Id: I37ba61b95c6850ea008fd6f7ac042bea783249d7
Diffstat (limited to 'src/lib/VSDContentCollector.cpp')
-rw-r--r--src/lib/VSDContentCollector.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/VSDContentCollector.cpp b/src/lib/VSDContentCollector.cpp
index e6e3268..da6b073 100644
--- a/src/lib/VSDContentCollector.cpp
+++ b/src/lib/VSDContentCollector.cpp
@@ -301,7 +301,7 @@ void libvisio::VSDContentCollector::_flushCurrentPath()
{
if (!wasMove)
{
- if ((x == prevX) && (y == prevY))
+ if (VSD_ALMOST_ZERO(x - prevX) && VSD_ALMOST_ZERO(y - prevY))
{
if (tmpPath.back()["librevenge:path-action"]->getStr() != "Z")
{
@@ -332,7 +332,7 @@ void libvisio::VSDContentCollector::_flushCurrentPath()
{
if (!wasMove)
{
- if ((x == prevX) && (y == prevY))
+ if (VSD_ALMOST_ZERO(x - prevX) && VSD_ALMOST_ZERO(y - prevY))
{
if (tmpPath.back()["librevenge:path-action"]->getStr() != "Z")
{