Skip to content

Commit 4fceeff

Browse files
Snipxyulian-gaponenko
authored andcommitted
Avoid width to exceed layout area if it is set to 100% for now until box-sizing is supported
DEVSIX-1053 Autoported commit. Original commit hash: [f6b179f34f]
1 parent f4ba0a8 commit 4fceeff

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

itext/itext.layout/itext/layout/renderer/BlockRenderer.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ public override LayoutResult Layout(LayoutContext layoutContext) {
103103
float[] paddings = GetPaddings();
104104
ApplyBordersPaddingsMargins(parentBBox, borders, paddings);
105105
if (blockWidth != null && (blockWidth < parentBBox.GetWidth() || isPositioned || rotation != null)) {
106-
parentBBox.SetWidth((float)blockWidth);
106+
// TODO DEVSIX-1174
107+
UnitValue widthVal = this.GetProperty<UnitValue>(Property.WIDTH);
108+
if (widthVal != null && widthVal.IsPercentValue() && widthVal.GetValue() == 100) {
109+
}
110+
else {
111+
parentBBox.SetWidth((float)blockWidth);
112+
}
107113
}
108114
float? blockMaxHeight = RetrieveMaxHeight();
109115
if (!IsFixedLayout() && null != blockMaxHeight && blockMaxHeight < parentBBox.GetHeight() && !true.Equals(

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
69920942204fdf9be8055cb6381af0d11e5c56e4
1+
f6b179f34ff30f1bf9dcc1ad26fa3b97a2317ba3

0 commit comments

Comments
 (0)