perspective: use Path2D for construction instead of area in get2DGeometry
Path2D is faster than area for appending and checking contains.
This commit is contained in:
@@ -29,6 +29,7 @@ import java.awt.Graphics2D;
|
|||||||
import java.awt.Polygon;
|
import java.awt.Polygon;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.geom.Area;
|
import java.awt.geom.Area;
|
||||||
|
import java.awt.geom.Path2D;
|
||||||
import java.awt.geom.Rectangle2D;
|
import java.awt.geom.Rectangle2D;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -546,7 +547,7 @@ public class Perspective
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
int radius = 5;
|
int radius = 5;
|
||||||
Area geometry = new Area();
|
Path2D.Double geometry = new Path2D.Double();
|
||||||
|
|
||||||
final int tileHeight = getTileHeight(client, point, client.getPlane());
|
final int tileHeight = getTileHeight(client, point, client.getPlane());
|
||||||
|
|
||||||
@@ -604,10 +605,10 @@ public class Perspective
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
geometry.add(new Area(clickableRect));
|
geometry.append(clickableRect, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return geometry;
|
return new Area(geometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Area getAABB(
|
private static Area getAABB(
|
||||||
|
|||||||
Reference in New Issue
Block a user