Skip to content

Commit

Permalink
fix(grid-iterators): off-by-one error in lineClipped()
Browse files Browse the repository at this point in the history
- update right/bottom clip coords
  • Loading branch information
postspectacular committed Dec 13, 2021
1 parent 5dfeb6d commit 537b17a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/grid-iterators/src/line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ export const lineClipped = (
right: number,
bottom: number
) => {
const res = liangBarsky(x1, y1, x2, y2, left, top, right, bottom);
const res = liangBarsky(x1, y1, x2, y2, left, top, right - 1, bottom - 1);
return res ? line(res[0], res[1], res[2], res[3]) : undefined;
};

0 comments on commit 537b17a

Please sign in to comment.