Skip to content

Commit 527c072

Browse files
committed
don't use java.awt in RectangleUtil #73
1 parent ad586d0 commit 527c072

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/main/java/com/github/davidmoten/rtree/internal/Line2D.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public boolean intersectsLine(Line2D l) {
200200
* otherwise.
201201
* @since 1.2
202202
*/
203-
private static boolean linesIntersect(double x1, double y1, double x2, double y2, double x3,
203+
public static boolean linesIntersect(double x1, double y1, double x2, double y2, double x3,
204204
double y3, double x4, double y4) {
205205
return ((relativeCCW(x1, y1, x2, y2, x3, y3) * relativeCCW(x1, y1, x2, y2, x4, y4) <= 0)
206206
&& (relativeCCW(x3, y3, x4, y4, x1, y1)

src/main/java/com/github/davidmoten/rtree/internal/RectangleUtil.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.github.davidmoten.rtree.internal;
22

3-
import java.awt.geom.Line2D;
4-
53
public final class RectangleUtil {
64

75
private RectangleUtil() {
@@ -43,7 +41,7 @@ private RectangleUtil() {
4341
public static boolean rectangleIntersectsLine(double rectX, double rectY, double rectWidth, double rectHeight,
4442
double x1, double y1, double x2, double y2) {
4543
return _rectangleIntersectsLine(rectX, rectY, rectWidth, rectHeight, x1, y1, x2, y2)
46-
|| Line2D.Double.linesIntersect(rectX, rectY, rectX + rectWidth, rectY + rectHeight, x1, y1, x2, y2);
44+
|| Line2D.linesIntersect(rectX, rectY, rectX + rectWidth, rectY + rectHeight, x1, y1, x2, y2);
4745
}
4846

4947
private static boolean _rectangleIntersectsLine(double rectX, double rectY, double rectWidth,

0 commit comments

Comments
 (0)