Skip to content

Commit 6f44350

Browse files
committed
Deprecate min-max methods with available width
This is done since min max width should be independent from layout context. DEVSIX-1505
1 parent e025ddc commit 6f44350

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

layout/src/main/java/com/itextpdf/layout/minmaxwidth/MinMaxWidth.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,26 @@ public class MinMaxWidth implements Serializable {
5353
private float additionalWidth;
5454
private float availableWidth;
5555

56+
public MinMaxWidth(float additionalWidth) {
57+
this(0, 0, additionalWidth);
58+
}
59+
60+
/**
61+
* @deprecated Will be removed in 7.1. Use {@link #MinMaxWidth(float)} instead.
62+
*/
63+
@Deprecated
5664
public MinMaxWidth(float additionalWidth, float availableWidth) {
5765
this(additionalWidth, availableWidth, 0, 0);
5866
}
5967

68+
public MinMaxWidth(float childrenMinWidth, float childrenMaxWidth, float additionalWidth) {
69+
this(additionalWidth, MinMaxWidthUtils.getMax(), childrenMinWidth, childrenMaxWidth);
70+
}
71+
72+
/**
73+
* @deprecated Will be removed in 7.1. Use {@link #MinMaxWidth(float, float, float)} instead.
74+
*/
75+
@Deprecated
6076
public MinMaxWidth(float additionalWidth, float availableWidth, float childrenMinWidth, float childrenMaxWidth) {
6177
this.childrenMinWidth = childrenMinWidth;
6278
this.childrenMaxWidth = childrenMaxWidth;
@@ -84,6 +100,10 @@ public float getAdditionalWidth() {
84100
return additionalWidth;
85101
}
86102

103+
/**
104+
* @deprecated Will be removed in 7.1. Available width should be always equal to {@link MinMaxWidthUtils#getMax()}
105+
*/
106+
@Deprecated
87107
public float getAvailableWidth() {
88108
return availableWidth;
89109
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,6 +1684,14 @@ protected void updateHeightsOnSplit(boolean wasHeightClipped, AbstractRenderer s
16841684
}
16851685
}
16861686

1687+
protected MinMaxWidth getMinMaxWidth() {
1688+
return getMinMaxWidth(MinMaxWidthUtils.getMax());
1689+
}
1690+
1691+
/**
1692+
* @deprecated Will be removed in 7.1. Use {@link #getMinMaxWidth()} instead.
1693+
*/
1694+
@Deprecated
16871695
protected MinMaxWidth getMinMaxWidth(float availableWidth) {
16881696
return MinMaxWidthUtils.countDefaultMinMaxWidth(this, availableWidth);
16891697
}

0 commit comments

Comments
 (0)