Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ArrayList<Point> getPoints(Polygon poly) {
- ArrayList<Point> p = new ArrayList<>();
- Rectangle rec = poly.getBounds();
- int x = (int) rec.getX();
- int y = (int) rec.getY();
- for (; x < rec.getWidth() + x; x++) {
- for (; y < rec.getHeight() + y; y++) {
- if(poly.contains(x,y)) {
- p.add(new Point(x,y));
- }
- }
- }
- return p;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement