Skip to content

Commit 0bcc19c

Browse files
introfogiText-CI
authored andcommitted
Implement supporting background-repeat CSS property
DEVSIX-4370 Autoported commit. Original commit hash: [8a3a77ae6]
1 parent 2b9abed commit 0bcc19c

31 files changed

+909
-230
lines changed

itext.tests/itext.kernel.tests/itext/kernel/geom/RectangleTest.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,50 @@ source product.
5050

5151
namespace iText.Kernel.Geom {
5252
public class RectangleTest : ExtendedITextTest {
53+
private const float OVERLAP_EPSILON = 0.1f;
54+
55+
[NUnit.Framework.Test]
56+
public virtual void OverlapWithEpsilon() {
57+
Rectangle first = new Rectangle(0, 0, 10, 10);
58+
Rectangle second = new Rectangle(-10, 0, 10.09f, 5);
59+
NUnit.Framework.Assert.IsFalse(first.Overlaps(second, OVERLAP_EPSILON));
60+
second.SetWidth(10.11f);
61+
NUnit.Framework.Assert.IsTrue(first.Overlaps(second, OVERLAP_EPSILON));
62+
second = new Rectangle(5, 9.91f, 5, 5);
63+
NUnit.Framework.Assert.IsFalse(first.Overlaps(second, OVERLAP_EPSILON));
64+
second.SetY(9.89f);
65+
NUnit.Framework.Assert.IsTrue(first.Overlaps(second, OVERLAP_EPSILON));
66+
second = new Rectangle(9.91f, 0, 5, 5);
67+
NUnit.Framework.Assert.IsFalse(first.Overlaps(second, OVERLAP_EPSILON));
68+
second.SetX(9.89f);
69+
NUnit.Framework.Assert.IsTrue(first.Overlaps(second, OVERLAP_EPSILON));
70+
second = new Rectangle(5, -10, 5, 10.09f);
71+
NUnit.Framework.Assert.IsFalse(first.Overlaps(second, OVERLAP_EPSILON));
72+
second.SetHeight(10.11f);
73+
NUnit.Framework.Assert.IsTrue(first.Overlaps(second, OVERLAP_EPSILON));
74+
}
75+
76+
[NUnit.Framework.Test]
77+
public virtual void OverlapWithNegativeEpsilon() {
78+
Rectangle first = new Rectangle(0, 0, 10, 10);
79+
Rectangle second = new Rectangle(-10, 0, 9.89f, 5);
80+
NUnit.Framework.Assert.IsFalse(first.Overlaps(second, -OVERLAP_EPSILON));
81+
second.SetWidth(9.91f);
82+
NUnit.Framework.Assert.IsTrue(first.Overlaps(second, -OVERLAP_EPSILON));
83+
second = new Rectangle(5, 10.11f, 5, 5);
84+
NUnit.Framework.Assert.IsFalse(first.Overlaps(second, -OVERLAP_EPSILON));
85+
second.SetY(10.09f);
86+
NUnit.Framework.Assert.IsTrue(first.Overlaps(second, -OVERLAP_EPSILON));
87+
second = new Rectangle(10.11f, 0, 5, 5);
88+
NUnit.Framework.Assert.IsFalse(first.Overlaps(second, -OVERLAP_EPSILON));
89+
second.SetX(10.09f);
90+
NUnit.Framework.Assert.IsTrue(first.Overlaps(second, -OVERLAP_EPSILON));
91+
second = new Rectangle(5, -10, 5, 9.89f);
92+
NUnit.Framework.Assert.IsFalse(first.Overlaps(second, -OVERLAP_EPSILON));
93+
second.SetHeight(9.91f);
94+
NUnit.Framework.Assert.IsTrue(first.Overlaps(second, -OVERLAP_EPSILON));
95+
}
96+
5397
[NUnit.Framework.Test]
5498
public virtual void RectangleOverlapTest01() {
5599
//Intersection

itext.tests/itext.layout.tests/itext/layout/BackgroundRepeatUnitTest.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

itext.tests/itext.layout.tests/itext/layout/BackgroundImageTest.cs renamed to itext.tests/itext.layout.tests/itext/layout/properties/BackgroundImageTest.cs

Lines changed: 65 additions & 48 deletions
Large diffs are not rendered by default.

itext.tests/itext.layout.tests/itext/layout/properties/BackgroundRepeatUnitTest.cs

Lines changed: 265 additions & 0 deletions
Large diffs are not rendered by default.

itext.tests/itext.layout.tests/itext/layout/renderer/AbstractRendererUnitTest.cs

Lines changed: 90 additions & 90 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)