Skip to content

Commit 5bda799

Browse files
Snipxitext-teamcity
authored andcommitted
Improve leading calculation for images. Tread images as inline-block elements
DEVSIX-1053 Autoported commit. Original commit hash: [e71ea19]
1 parent 09d12a9 commit 5bda799

File tree

6 files changed

+3
-3
lines changed

6 files changed

+3
-3
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

itext/itext.layout/itext/layout/renderer/LineRenderer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public override LayoutResult Layout(LayoutContext layoutContext) {
311311
}
312312
maxAscent = Math.Max(maxAscent, childAscent);
313313
// TODO treat images as blocks
314-
if (childRenderer is TextRenderer || childRenderer is ImageRenderer) {
314+
if (childRenderer is TextRenderer) {
315315
maxTextAscent = Math.Max(maxTextAscent, childAscent);
316316
}
317317
else {
@@ -321,7 +321,7 @@ public override LayoutResult Layout(LayoutContext layoutContext) {
321321
}
322322
maxDescent = Math.Min(maxDescent, childDescent);
323323
// TODO treat images as blocks
324-
if (childRenderer is TextRenderer || childRenderer is ImageRenderer) {
324+
if (childRenderer is TextRenderer) {
325325
maxTextDescent = Math.Min(maxTextDescent, childDescent);
326326
}
327327
else {

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8a3dc5646eacef9df7fe8f01d6836105069f135a
1+
e71ea191740cc0888a3b63d7b7d8b731fba592dc

0 commit comments

Comments
 (0)