fix typo in condition
authorMike Erwin <significant.bit@gmail.com>
Thu, 21 Jul 2016 18:13:20 +0000 (14:13 -0400)
committerMike Erwin <significant.bit@gmail.com>
Thu, 21 Jul 2016 19:53:39 +0000 (15:53 -0400)
(A - A).norm() is always 0 so condition is always true.

(A - B).norm() and (B - A).norm() both compute the same distance so I
picked one to match surrounding code.

Found with PVS-Studio T48917

source/blender/freestyle/intern/stroke/Curve.cpp

index 69c5dcdfe280cf2ec0bf43b7a62408dacc2c091b..a8dbce84971ec5e789962ed41f31eac388629f16 100644 (file)
@@ -133,7 +133,7 @@ iA_B_eq_iB_A:
                        //_t2d = t3;
                        _t2d = t2 * t3;
                }
-               else if ((iA->getPoint2D() - iA->getPoint2D()).norm() < 1.0e-6) {
+               else if ((iA->getPoint2D() - iB->getPoint2D()).norm() < 1.0e-6) {
                        __A = iB->A();
                        __B = iB->B();
                        //_t2d = t3;