Skip to content

Commit 30e26f4

Browse files
committed
handle horizontal edge
1 parent 4f2bce4 commit 30e26f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/web_app/lib/src/widget/downloads_chart/computations.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ bool isPointInPolygon(List<(double, double)> polygon, (double, double) point) {
158158

159159
if (py > min(y1, y2) && py <= max(y1, y2)) {
160160
double intersectX;
161-
// vertical edge
162-
if (x1 == x2) {
163-
intersectX = x1;
161+
if (y1 == y2) {
162+
// horizontal edge
163+
continue;
164164
} else {
165165
intersectX = x1 + (py - y1) * (x2 - x1) / (y2 - y1);
166166
}

0 commit comments

Comments
 (0)