mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared] CurveView: avoid overflowing KDCoordinate
This fixes the following bug: add the sequence, u(n)=2^n. On the graph, go to "sum of terms" and try to sum terms from 0 to 18 by moving the cursor. It hangs.
This commit is contained in:
committed by
LeaNumworks
parent
17fd1aea29
commit
8e025b0823
@@ -426,6 +426,10 @@ void CurveView::drawHorizontalOrVerticalSegment(KDContext * ctx, KDRect rect, Ax
|
||||
if (rect.intersects(lineRect)) {
|
||||
ctx->fillRect(lineRect, color);
|
||||
}
|
||||
if (i > KDCOORDINATE_MAX - 2*dashSize) {
|
||||
// Avoid overflowing KDCoordinate
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user