Skip to content

Commit

Permalink
Merge branch 'develop' into devsecops
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-ivanov committed Nov 13, 2024
2 parents 53ba401 + 3be4185 commit b6af38b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,31 @@ public virtual void CollapsingMarginsTest05() {
, "diff"));
}

[NUnit.Framework.Test]
public virtual void CollapsingMarginsTest06() {
String outFileName = destinationFolder + "collapsingMarginsTest06.pdf";
String cmpFileName = sourceFolder + "cmp_collapsingMarginsTest06.pdf";
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outFileName));
DrawPageBorders(pdfDocument, 1);
Document doc = new Document(pdfDocument);
doc.SetProperty(Property.COLLAPSING_MARGINS, true);
Div container = new Div();
container.SetBackgroundColor(new DeviceRgb(209, 247, 29));
container.SetMarginBottom(30.0f);
container.SetMarginTop(30.0f);
List list = new List();
ListItem listItem = new ListItem("test");
listItem.SetProperty(Property.COLLAPSING_MARGINS, null);
listItem.SetMargins(20.0f, 5.0f, 20.0f, 5.0f);
listItem.SetBackgroundColor(new DeviceRgb(65, 151, 29));
list.Add(listItem);
container.Add(list);
doc.Add(container);
doc.Close();
NUnit.Framework.Assert.IsNull(new CompareTool().CompareByContent(outFileName, cmpFileName, destinationFolder
, "diff"));
}

[NUnit.Framework.Test]
public virtual void ElementCollapsingMarginsTest01() {
String outFileName = destinationFolder + "elementCollapsingMarginsTest01.pdf";
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ public virtual void EndMarginsCollapse(Rectangle layoutBox) {
MarginsCollapse ownCollapseAfter;
bool lastChildMarginJoinedToParent = prevChildMarginInfo != null && prevChildMarginInfo.IsIgnoreOwnMarginBottom
() && !lastKidCollapsedAfterHasClearanceApplied;
if (lastChildMarginJoinedToParent) {
//Checking prevChildMarginInfo#ownCollapseAfter for null, because there can be a case where margin collapse
//is enabled for the parent, but disabled for the child, in such a case prevChildMarginInfo#ownCollapseAfter
//value will be null and the above condition can still be met
if (lastChildMarginJoinedToParent && prevChildMarginInfo.GetOwnCollapseAfter() != null) {
ownCollapseAfter = prevChildMarginInfo.GetOwnCollapseAfter();
}
else {
Expand Down
2 changes: 1 addition & 1 deletion port-hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2ac55dcea1fe0e7cc96a54d64452047dae7f9630
97e38c41fff71c060c0cd17e2edc3fc5a9eea145

0 comments on commit b6af38b

Please sign in to comment.