vector: lower the tolerance value of VDasher from 1.0 to 0.1
authorsubhransu mohanty <sub.mohanty@samsung.com>
Thu, 17 Oct 2019 00:56:15 +0000 (09:56 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Wed, 13 Nov 2019 00:44:45 +0000 (09:44 +0900)
src/vector/vdasher.cpp

index a22b684..d06b617 100644 (file)
@@ -25,6 +25,7 @@
 
 V_BEGIN_NAMESPACE
 
+static constexpr float tolerance = 0.1f;
 VDasher::VDasher(const float *dashArray, size_t size)
 {
     mDashArray = reinterpret_cast<const VDasher::Dash *>(dashArray);
@@ -131,13 +132,13 @@ void VDasher::lineTo(const VPointF &p)
             mCurPt = line.p1();
         }
         // handle remainder
-        if (length > 1.0f) {
+        if (length > tolerance) {
             mCurrentLength -= length;
             addLine(line.p2());
         }
     }
 
-    if (mCurrentLength < 1.0f) updateActiveSegment();
+    if (mCurrentLength < tolerance) updateActiveSegment();
 
     mCurPt = p;
 }
@@ -174,13 +175,13 @@ void VDasher::cubicTo(const VPointF &cp1, const VPointF &cp2, const VPointF &e)
             mCurPt = b.pt1();
         }
         // handle remainder
-        if (bezLen > 1.0f) {
+        if (bezLen > tolerance) {
             mCurrentLength -= bezLen;
             addCubic(b.pt2(), b.pt3(), b.pt4());
         }
     }
 
-    if (mCurrentLength < 1.0f) updateActiveSegment();
+    if (mCurrentLength < tolerance) updateActiveSegment();
 
     mCurPt = e;
 }