use of com.itextpdf.kernel.geom.Line in project i7j-pdfsweep by itext.
the class PdfCleanUpFilter method constructSquare.
private static Subpath constructSquare(Point squareCenter, double widthHalf, double rotationAngle) {
// Orthogonal square is the square with sides parallel to one of the axes.
Point[] ortogonalSquareVertices = { new Point(-widthHalf, -widthHalf), new Point(-widthHalf, widthHalf), new Point(widthHalf, widthHalf), new Point(widthHalf, -widthHalf) };
Point[] rotatedSquareVertices = getRotatedSquareVertices(ortogonalSquareVertices, rotationAngle, squareCenter);
Subpath square = new Subpath();
square.addSegment(new Line(rotatedSquareVertices[0], rotatedSquareVertices[1]));
square.addSegment(new Line(rotatedSquareVertices[1], rotatedSquareVertices[2]));
square.addSegment(new Line(rotatedSquareVertices[2], rotatedSquareVertices[3]));
square.addSegment(new Line(rotatedSquareVertices[3], rotatedSquareVertices[0]));
return square;
}