Fix coords

This commit is contained in:
Svetlana Kulikova
2025-08-27 15:18:59 +03:00
parent 5c98a92faf
commit bb40cd0467
2 changed files with 16 additions and 6 deletions

View File

@ -812,6 +812,7 @@ void CPdfReader::DrawPageOnRenderer(IRenderer* pRenderer, int _nPageIndex, bool*
((GlobalParamsAdaptor*)globalParams)->ClearRedact();
pRenderer->SetTransform(1, 0, 0, 1, 0, 0);
for (int i = 0 ; i < m_vRedact.size(); ++i)
{
if (m_vRedact[i]->m_nPageIndex == _nPageIndex)
@ -827,12 +828,13 @@ void CPdfReader::DrawPageOnRenderer(IRenderer* pRenderer, int _nPageIndex, bool*
ret = *((int*)pMemory);
double B = ret / 100000.0;
LONG lColor = (LONG)(((LONG)(R * 255)) | ((LONG)(G * 255) << 8) | ((LONG)(B * 255) << 16) | ((LONG)255 << 24));
pRenderer->PathCommandClose();
pRenderer->PathCommandEnd();
pRenderer->put_BrushColor1(lColor);
pRenderer->PathCommandMoveTo(m_vRedact[i]->m_arrRedactBox[0], m_vRedact[i]->m_arrRedactBox[1]);
pRenderer->PathCommandLineTo(m_vRedact[i]->m_arrRedactBox[0], m_vRedact[i]->m_arrRedactBox[3]);
pRenderer->PathCommandLineTo(m_vRedact[i]->m_arrRedactBox[2], m_vRedact[i]->m_arrRedactBox[3]);
pRenderer->PathCommandLineTo(m_vRedact[i]->m_arrRedactBox[2], m_vRedact[i]->m_arrRedactBox[1]);
pRenderer->PathCommandMoveTo(PdfReader::PDFCoordsToMM(m_vRedact[i]->m_arrRedactBox[0]), PdfReader::PDFCoordsToMM(m_vRedact[i]->m_arrRedactBox[1]));
pRenderer->PathCommandLineTo(PdfReader::PDFCoordsToMM(m_vRedact[i]->m_arrRedactBox[0]), PdfReader::PDFCoordsToMM(m_vRedact[i]->m_arrRedactBox[3]));
pRenderer->PathCommandLineTo(PdfReader::PDFCoordsToMM(m_vRedact[i]->m_arrRedactBox[2]), PdfReader::PDFCoordsToMM(m_vRedact[i]->m_arrRedactBox[3]));
pRenderer->PathCommandLineTo(PdfReader::PDFCoordsToMM(m_vRedact[i]->m_arrRedactBox[2]), PdfReader::PDFCoordsToMM(m_vRedact[i]->m_arrRedactBox[1]));
pRenderer->PathCommandClose();
pRenderer->DrawPath(c_nWindingFillMode);
pRenderer->PathCommandEnd();