We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a96ae8a commit c1f6bd7Copy full SHA for c1f6bd7
src/extras/BuildingShapeUtils.js
@@ -362,8 +362,13 @@ class BuildingShapeUtils extends ShapeUtils {
362
if (vec.x === point[0] && vec.y === point[1]) {
363
return true;
364
}
365
- if ((vec.x >= point[0] || nextvec.x >= point[0]) && (vec.y >= point[1] !== nextvec.y >= point[1])) {
+ const slope = (nextvec.y - vec.y) / (nextvec.x - vec.x);
366
+ const intercept = v.y / slope / v.x;
367
+ const intersection = (point[1] - intercept) / slope;
368
+ if (intersection > point[0]) {
369
count++;
370
+ } else if (intersection == point[0]) {
371
+ return true;
372
373
374
return count % 2 === 1;
0 commit comments