mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-06-28 15:30:17 +08:00
Follow suggestion by @BobLd, added 2 more test cases for if we want to
support more lenient page size parsing in the future.
This commit is contained in:
parent
048caedd64
commit
a07fdb8d45
@ -1699,6 +1699,8 @@
|
|||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData(595, 842, PageSize.A4)]
|
[InlineData(595, 842, PageSize.A4)]
|
||||||
|
[InlineData(594, 843, PageSize.Custom)]
|
||||||
|
[InlineData(596, 841, PageSize.Custom)]
|
||||||
[InlineData(842, 595, PageSize.A4)]
|
[InlineData(842, 595, PageSize.A4)]
|
||||||
[InlineData(595.3, 841.5, PageSize.A4)]
|
[InlineData(595.3, 841.5, PageSize.A4)]
|
||||||
[InlineData(841.5, 595.3, PageSize.A4)]
|
[InlineData(841.5, 595.3, PageSize.A4)]
|
||||||
|
@ -150,8 +150,8 @@
|
|||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
return obj is WidthHeight height &&
|
return obj is WidthHeight height &&
|
||||||
Math.Abs(Width - height.Width) < 1 &&
|
Math.Round(Width) == Math.Round(height.Width) &&
|
||||||
Math.Abs(Height - height.Height) < 1;
|
Math.Round(Height) == Math.Round(height.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
|
Loading…
Reference in New Issue
Block a user