mirror of
https://github.com/UglyToad/PdfPig.git
synced 2026-03-10 00:23:29 +08:00
Fix PatternColor Equals() method and fix #1016
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Binary file not shown.
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user