Skip to content

Commit e71ea19

Browse files
committed
Improve leading calculation for images. Tread images as inline-block elements
DEVSIX-1053
1 parent 8a3dc56 commit e71ea19

File tree

5 files changed

+2
-2
lines changed

5 files changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,14 @@ public LineLayoutResult layout(LayoutContext layoutContext) {
321321

322322
maxAscent = Math.max(maxAscent, childAscent);
323323
// TODO treat images as blocks
324-
if (childRenderer instanceof TextRenderer || childRenderer instanceof ImageRenderer) {
324+
if (childRenderer instanceof TextRenderer) {
325325
maxTextAscent = Math.max(maxTextAscent, childAscent);
326326
} else if (!isChildFloating) {
327327
maxBlockAscent = Math.max(maxBlockAscent, childAscent);
328328
}
329329
maxDescent = Math.min(maxDescent, childDescent);
330330
// TODO treat images as blocks
331-
if (childRenderer instanceof TextRenderer || childRenderer instanceof ImageRenderer) {
331+
if (childRenderer instanceof TextRenderer) {
332332
maxTextDescent = Math.min(maxTextDescent, childDescent);
333333
} else if (!isChildFloating) {
334334
maxBlockDescent = Math.min(maxBlockDescent, childDescent);
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)