We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d9de00 commit dc95769Copy full SHA for dc95769
1 file changed
wcag-validation/src/main/java/org/verapdf/gf/model/factory/chunks/TextPieces.java
@@ -144,13 +144,17 @@ public double getEndX() {
144
public double getStartX() {
145
return startX;
146
}
147
+
148
+ public double getCenterX() {
149
+ return (getStartX() + getEndX()) / 2;
150
+ }
151
152
153
public static class TextPieceComparator implements Comparator<TextPiece> {
154
155
@Override
156
public int compare(TextPiece textPiece1, TextPiece textPiece2){
- int res = Double.compare(textPiece1.startX, textPiece2.startX);
157
+ int res = Double.compare(textPiece1.getCenterX(), textPiece2.getCenterX());
158
if (res != 0) {
159
return res;
160
0 commit comments