Fix a rendering bug with unwanted lines. Remove the code in CFX_PathData::GetZeroAreaPath() that triggers this bug. Update the pixel test expectation with the correct rendering. Bug: pdfium:1374 Change-Id: Ib00127f5b854b248331dcf60779336e3bc5bed6c Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/58492 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fxge/cfx_pathdata.cpp b/core/fxge/cfx_pathdata.cpp index df0ce4d..078a180 100644 --- a/core/fxge/cfx_pathdata.cpp +++ b/core/fxge/cfx_pathdata.cpp
@@ -30,11 +30,6 @@ (a.y - b.y) * (c.x - b.x) == (c.y - b.y) * (a.x - b.x); } -bool IsClosedFigure(const FX_PATHPOINT& prev, const FX_PATHPOINT& next) { - return prev.m_Type == FXPT_TYPE::MoveTo && next.m_Type == FXPT_TYPE::LineTo && - prev.m_Point == next.m_Point && next.m_CloseFigure; -} - void UpdateLineEndPoints(CFX_FloatRect* rect, const CFX_PointF& start_pos, const CFX_PointF& end_pos, @@ -423,12 +418,6 @@ NewPath->AppendPoint(end.m_Point, FXPT_TYPE::LineTo, false); continue; } - - if (IsClosedFigure(prev, next)) { - NewPath->AppendPoint(prev.m_Point, FXPT_TYPE::MoveTo, false); - NewPath->AppendPoint(cur.m_Point, FXPT_TYPE::LineTo, false); - *bThin = true; - } } size_t new_path_size = NewPath->GetPoints().size();
diff --git a/testing/resources/pixel/bug_1374_expected.pdf.0.png b/testing/resources/pixel/bug_1374_expected.pdf.0.png index 89c3949e..319932a 100644 --- a/testing/resources/pixel/bug_1374_expected.pdf.0.png +++ b/testing/resources/pixel/bug_1374_expected.pdf.0.png Binary files differ