Skip to content

Commit

Permalink
also test for whether the padding intersects
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellpeck committed Nov 7, 2024
1 parent 534521a commit 75f7085
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tests/TexturePackerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,18 @@ public void TestOverlap([Values(0, 1, 5, 10)] int padding) {
}

foreach (var r1 in packed) {
var r1Padded = r1.Area;
r1Padded.Inflate(padding, padding);

foreach (var r2 in packed) {
if (r1 == r2)
continue;

Assert.False(r1.Area.Intersects(r2.Area));

var r2Padded = r2.Area;
r2Padded.Inflate(padding, padding);
Assert.False(r1Padded.Intersects(r2Padded));
}
}
}
Expand Down

0 comments on commit 75f7085

Please sign in to comment.