Fix `zero_area` flag in CFX_PathData::GetZeroAreaPath().
`zero_area` in CFX_PathData::GetZeroAreaPath() should indicate that when
`m_Points` is a palindromic, it forms a thin line that covers zero area.
However the assigned value for this variable represents the opposite.
This CL fixes this issue and leaves the rendering process intact.
Change-Id: Ia2ccbfb4d39691590723ed7a4f43b2e7c99892af
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/77872
Commit-Queue: Hui Yingst <nigi@chromium.org>
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
diff --git a/core/fxge/cfx_pathdata.cpp b/core/fxge/cfx_pathdata.cpp
index 68f2a4b..7e08205 100644
--- a/core/fxge/cfx_pathdata.cpp
+++ b/core/fxge/cfx_pathdata.cpp
@@ -359,20 +359,20 @@
if (((m_Points.size() > 3) && (m_Points.size() % 2))) {
int mid = m_Points.size() / 2;
- bool zero_area = false;
+ bool zero_area = true;
CFX_PathData temp_path;
for (int i = 0; i < mid; i++) {
if (!(m_Points[mid - i - 1].m_Point == m_Points[mid + i + 1].m_Point &&
m_Points[mid - i - 1].m_Type != FXPT_TYPE::BezierTo &&
m_Points[mid + i + 1].m_Type != FXPT_TYPE::BezierTo)) {
- zero_area = true;
+ zero_area = false;
break;
}
temp_path.AppendPoint(m_Points[mid - i].m_Point, FXPT_TYPE::MoveTo);
temp_path.AppendPoint(m_Points[mid - i - 1].m_Point, FXPT_TYPE::LineTo);
}
- if (!zero_area) {
+ if (zero_area) {
new_path->Append(&temp_path, nullptr);
*thin = true;
return true;