Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99af9429 authored by ztenghui's avatar ztenghui
Browse files

Fix the missing spot shadow when DEBUG_SHADOW is turned on

In the current design, this error should be tolerated since the delta should
be small enough. So we should not return here.

Change-Id: I251db2882b331d37ae7f0896e9aa95d69a5650da
parent 50ecf849
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -62,7 +62,9 @@ static float rayIntersectPoints(const Vector2& rayOrigin, float dx, float dy,

#if DEBUG_SHADOW
    double interpVal = (dx * (p1.y - rayOrigin.y) + dy * rayOrigin.x - dy * p1.x) / divisor;
    if (interpVal < 0 || interpVal > 1) return -1.0f; // error, doesn't intersect between points
    if (interpVal < 0 || interpVal > 1) {
        ALOGW("rayIntersectPoints is hitting outside the segment %f", interpVal);
    }
#endif

    double distance = (p1.x * (rayOrigin.y - p2.y) + p2.x * (p1.y - rayOrigin.y) +