summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2021-02-09 12:34:09 -0600
committerColin Okay <okay@toyful.space>2021-02-09 12:34:09 -0600
commit8137621ad5f12cc4dc224886d1259049334c9099 (patch)
tree1ea84d0a33a5d33ad86cc8c57d1c2eff89f6d069
parente3632b547ca97e8a13d7574ead09c482d1c92b96 (diff)
consoladated utility classes
-rw-r--r--Source/Main.hx7
1 files changed, 2 insertions, 5 deletions
diff --git a/Source/Main.hx b/Source/Main.hx
index f188c56..5414233 100644
--- a/Source/Main.hx
+++ b/Source/Main.hx
@@ -152,7 +152,7 @@ class DrawingScreen extends Sprite
(stamp - timestamp > sampleRate) &&
Point.distance(pt, path[path.length - 1]) >= sampleGap)
{
- var selfIntersection = PathTools.findSelfIntersection(path, pt);
+ var selfIntersection = GeomTools.findSelfIntersection(path, pt);
timestamp = stamp;
path.push( pt );
graphics.lineTo( pt.x, pt.y);
@@ -216,10 +216,7 @@ class GeomTools
return null;
}
}
-}
-class PathTools
-{
// given a path and a point, check of the line between the last
// point in tha path and the provided point intersects the path. If
// it does, the index of the path point before the
@@ -231,7 +228,7 @@ class PathTools
{
var last = path.length -1;
for (i in 1...last)
- if (GeomTools.segmentsIntersect( path[i-1], path[i], path[last], pt))
+ if ( segmentsIntersect( path[i-1], path[i], path[last], pt) )
return i-1;
}
return null;