Skip to content

Commit 07da24d

Browse files
committed
Add ElementPropertyContainer#setHeightPercent() method.
Unignore test. DEVSIX-1658
1 parent 93dc060 commit 07da24d

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

layout/src/main/java/com/itextpdf/layout/ElementPropertyContainer.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,17 @@ public T setHeight(float height) {
188188
return (T) (Object) this;
189189
}
190190

191+
/**
192+
* Sets the height property of the Element, measured in percentage.
193+
*
194+
* @param heightPercent a value measured in percentage.
195+
* @return this Element.
196+
*/
197+
public T setHeightPercent(float heightPercent) {
198+
setProperty(Property.HEIGHT, UnitValue.createPercentValue(heightPercent));
199+
return (T) (Object) this;
200+
}
201+
191202
/**
192203
* Sets the width property of the Element with a {@link UnitValue}.
193204
*
@@ -198,6 +209,7 @@ public T setHeight(UnitValue height) {
198209
setProperty(Property.HEIGHT, height);
199210
return (T) (Object) this;
200211
}
212+
201213
/**
202214
* Sets values for a relative repositioning of the Element. Also has as a
203215
* side effect that the Element's {@link Property#POSITION} is changed to

layout/src/test/java/com/itextpdf/layout/ImageTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,8 @@ public void imageTest18() throws IOException, InterruptedException {
494494

495495
Assert.assertNull(new CompareTool().compareByContent(outFileName, cmpFileName, destinationFolder, "diff"));
496496
}
497-
@Ignore("DEVSIX-1658")
497+
498+
//TODO(DEVSIX-1658)
498499
@Test
499500
public void imageTest19() throws IOException, InterruptedException {
500501
String outFileName = destinationFolder + "imageTest19.pdf";
Binary file not shown.

0 commit comments

Comments
 (0)