Fix PatternColor Equals() method and fix #1016

This commit is contained in:
BobLd
2025-03-26 19:38:29 +00:00
parent ba8e1e1b45
commit 74d61bd985
3 changed files with 25 additions and 2 deletions

View File

@@ -7,6 +7,29 @@
public class GithubIssuesTests
{
[Fact]
public void Issue1016()
{
// Doc has letters with Shading pattern color
var path = IntegrationHelpers.GetSpecificTestDocumentPath("colorcomparecrash.pdf");
using (var document = PdfDocument.Open(path, new ParsingOptions() { UseLenientParsing = true, SkipMissingFonts = true }))
{
var page = document.GetPage(1);
var letters = page.Letters;
var firstLetter = letters[0];
Assert.NotNull(firstLetter.Color);
var secondLetter = letters[1];
Assert.NotNull(secondLetter.Color);
Assert.True(firstLetter.Color.Equals(secondLetter.Color));
}
}
[Fact]
public void Issue953()
{

View File

@@ -158,7 +158,7 @@
return PatternType.Equals(other.PatternType) &&
Matrix.Equals(other.Matrix) &&
ExtGState.Equals(other.ExtGState) &&
((ExtGState is null && other.ExtGState is null) || ExtGState?.Equals(other.ExtGState) == true) &&
PaintType.Equals(other.PaintType) &&
TilingType.Equals(other.TilingType) &&
BBox.Equals(other.BBox) &&
@@ -225,7 +225,7 @@
return PatternType.Equals(other.PatternType) &&
Matrix.Equals(other.Matrix) &&
ExtGState.Equals(other.ExtGState) &&
((ExtGState is null && other.ExtGState is null) || ExtGState?.Equals(other.ExtGState) == true) &&
Shading.Equals(other.Shading);
}