Skip to content

Commit 2e69468

Browse files
yulian-gaponenkoars18wrw
authored andcommitted
Add EPS to clear correction value and to floating box top border when identifying floats at y line in order to avoid precision issues
Autoported commit. Original commit hash: [e96cd7b]
1 parent 611fc2e commit 2e69468

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

itext/itext.layout/itext/layout/renderer/FloatingHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ internal static float CalculateClearHeightCorrection(IRenderer renderer, IList<R
297297
}
298298
}
299299
if (lowestFloatBottom < float.MaxValue) {
300-
clearHeightCorrection = parentBBox.GetTop() - lowestFloatBottom;
300+
clearHeightCorrection = parentBBox.GetTop() - lowestFloatBottom + AbstractRenderer.EPS;
301301
}
302302
return clearHeightCorrection;
303303
}
@@ -355,7 +355,7 @@ private static Rectangle[] FindLastLeftAndRightBoxes(Rectangle layoutBox, IList<
355355
private static IList<Rectangle> GetBoxesAtYLevel(IList<Rectangle> floatRendererAreas, float currY) {
356356
IList<Rectangle> yLevelBoxes = new List<Rectangle>();
357357
foreach (Rectangle box in floatRendererAreas) {
358-
if (box.GetBottom() < currY && box.GetTop() >= currY) {
358+
if (box.GetBottom() < currY && box.GetTop() + AbstractRenderer.EPS >= currY) {
359359
yLevelBoxes.Add(box);
360360
}
361361
}

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
66f95dd41bc82697fdc47f1da676db720bf42ebb
1+
e96cd7b6af3679b0f4ebbb90d3753167f397180a

0 commit comments

Comments
 (0)