Skip to content

Commit 598150e

Browse files
committed
Add markers support
DEVSIX-2860
1 parent 5a556a8 commit 598150e

File tree

134 files changed

+4026
-445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+4026
-445
lines changed

kernel/src/main/java/com/itextpdf/kernel/geom/Rectangle.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,16 @@ public static Rectangle calculateBBox(List<Point> points) {
185185
return new Rectangle((float) left, (float) bottom, (float) (right - left), (float) (top - bottom));
186186
}
187187

188+
/**
189+
* Convert rectangle to an array of points
190+
*
191+
* @return array of four extreme points of rectangle
192+
*/
193+
public Point[] toPointsArray() {
194+
return new Point[] {new Point(x, y), new Point(x + width, y),
195+
new Point(x + width, y + height), new Point(x, y + height)};
196+
}
197+
188198
/**
189199
* Get the rectangle representation of the intersection between this rectangle and the passed rectangle
190200
*

layout/src/main/java/com/itextpdf/layout/renderer/AbstractRenderer.java

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,24 +2002,11 @@ protected Rectangle calculateAbsolutePdfBBox() {
20022002
* @return array of float values which denote left, bottom, right, top lines of bbox in this specific order
20032003
*/
20042004
protected Rectangle calculateBBox(List<Point> points) {
2005-
double minX = Double.MAX_VALUE;
2006-
double minY = Double.MAX_VALUE;
2007-
double maxX = -Double.MAX_VALUE;
2008-
double maxY = -Double.MAX_VALUE;
2009-
for (Point p : points) {
2010-
minX = Math.min(p.getX(), minX);
2011-
minY = Math.min(p.getY(), minY);
2012-
maxX = Math.max(p.getX(), maxX);
2013-
maxY = Math.max(p.getY(), maxY);
2014-
}
2015-
return new Rectangle((float) minX, (float) minY, (float) (maxX - minX), (float) (maxY - minY));
2005+
return Rectangle.calculateBBox(points);
20162006
}
20172007

20182008
protected List<Point> rectangleToPointsList(Rectangle rect) {
2019-
List<Point> points = new ArrayList<>();
2020-
points.addAll(Arrays.asList(new Point(rect.getLeft(), rect.getBottom()), new Point(rect.getRight(), rect.getBottom()),
2021-
new Point(rect.getRight(), rect.getTop()), new Point(rect.getLeft(), rect.getTop())));
2022-
return points;
2009+
return Arrays.asList(rect.toPointsArray());
20232010
}
20242011

20252012
protected List<Point> transformPoints(List<Point> points, AffineTransform transform) {

styled-xml-parser/src/main/java/com/itextpdf/styledxmlparser/LogMessageConstant.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public final class LogMessageConstant {
5757
public static final String ERROR_PARSING_CSS_SELECTOR = "Error while parsing css selector: {0}";
5858
/** The Constant UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED. */
5959
public static final String UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED = "Unknown absolute metric length parsed \"{0}\".";
60+
public static final String UNKNOWN_METRIC_ANGLE_PARSED = "Unknown metric angle parsed: \"{0}\".";
6061
public static final String URL_IS_EMPTY_IN_CSS_EXPRESSION = "url function is empty in expression:{0}";
6162
public static final String URL_IS_NOT_CLOSED_IN_CSS_EXPRESSION = "url function is not properly closed in expression:{0}";
6263
/** The Constant QUOTES_PROPERTY_INVALID. */

styled-xml-parser/src/main/java/com/itextpdf/styledxmlparser/css/CommonCssConstants.java

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,11 @@ public class CommonCssConstants {
488488
*/
489489
public static final String OVERFLOW_WRAP = "overflow-wrap";
490490

491+
/**
492+
* The Constant OVERFLOW.
493+
*/
494+
public static final String OVERFLOW = "overflow";
495+
491496
/**
492497
* The Constant PADDING.
493498
*/
@@ -741,8 +746,11 @@ public class CommonCssConstants {
741746
public static final String DECIMAL_LEADING_ZERO = "decimal-leading-zero";
742747

743748
/**
744-
* The Constant DISC.
749+
* The Constant DEG.
745750
*/
751+
public static final String DEG = "deg";
752+
753+
/** The Constant DISC. */
746754
public static final String DISC = "disc";
747755

748756
/**
@@ -765,9 +773,10 @@ public class CommonCssConstants {
765773
*/
766774
public static final String GEORGIAN = "georgian";
767775

768-
/**
769-
* The Constant GROOVE.
770-
*/
776+
/** The Constant GRAD. */
777+
public static final String GRAD = "grad";
778+
779+
/** The Constant GROOVE. */
771780
public static final String GROOVE = "groove";
772781

773782
/**
@@ -940,6 +949,11 @@ public class CommonCssConstants {
940949
*/
941950
public static final String PADDING_BOX = "padding-box";
942951

952+
/**
953+
* The Constant RAD.
954+
*/
955+
public static final String RAD = "rad";
956+
943957
/**
944958
* The Constant REPEAT.
945959
*/
@@ -1175,6 +1189,12 @@ public class CommonCssConstants {
11751189
*/
11761190
public static final Map<String, String> FONT_ABSOLUTE_SIZE_KEYWORDS_VALUES;
11771191

1192+
/**
1193+
* The Constant METRIC_MEASUREMENTS.
1194+
*/
1195+
public static final String[] METRIC_MEASUREMENTS_VALUES = new String[] {CommonCssConstants.PX, CommonCssConstants.IN,
1196+
CommonCssConstants.CM, CommonCssConstants.MM, CommonCssConstants.PC, CommonCssConstants.PT, CommonCssConstants.Q};
1197+
11781198
// pseudo-classes
11791199

11801200
/**

0 commit comments

Comments
 (0)