Skip to content

Commit

Permalink
Fix top-left edge of hitbox missing
Browse files Browse the repository at this point in the history
  • Loading branch information
webfiltered committed Nov 2, 2024
1 parent 219de41 commit ef2d2f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/measure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export function dist2(a: ReadOnlyPoint, b: ReadOnlyPoint): number {
* @returns `true` if the point is inside the rect, otherwise `false`
*/
export function isPointInRectangle(point: ReadOnlyPoint, rect: ReadOnlyRect): boolean {
return rect[0] < point[0]
return rect[0] <= point[0]
&& rect[0] + rect[2] > point[0]
&& rect[1] < point[1]
&& rect[1] <= point[1]
&& rect[1] + rect[3] > point[1]
}

Expand Down

0 comments on commit ef2d2f0

Please sign in to comment.