Skip to content

Commit e96cd7b

Browse files
Add EPS to clear correction value and to floating box top border when identifying floats at y line in order to avoid precision issues
1 parent 66f95dd commit e96cd7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ static float calculateClearHeightCorrection(IRenderer renderer, List<Rectangle>
289289
}
290290
}
291291
if (lowestFloatBottom < Float.MAX_VALUE) {
292-
clearHeightCorrection = parentBBox.getTop() - lowestFloatBottom;
292+
clearHeightCorrection = parentBBox.getTop() - lowestFloatBottom + AbstractRenderer.EPS;
293293
}
294294

295295
return clearHeightCorrection;
@@ -346,7 +346,7 @@ private static Rectangle[] findLastLeftAndRightBoxes(Rectangle layoutBox, List<R
346346
private static List<Rectangle> getBoxesAtYLevel(List<Rectangle> floatRendererAreas, float currY) {
347347
List<Rectangle> yLevelBoxes = new ArrayList<>();
348348
for (Rectangle box : floatRendererAreas) {
349-
if (box.getBottom() < currY && box.getTop() >= currY) {
349+
if (box.getBottom() < currY && box.getTop() + AbstractRenderer.EPS >= currY) {
350350
yLevelBoxes.add(box);
351351
}
352352
}

0 commit comments

Comments
 (0)