mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Fix intersection line and rectangles
This commit is contained in:
@ -1654,7 +1654,6 @@ bool CPdfEditor::EditPage(int _nPageIndex, bool bSet, bool bActualPos)
|
||||
if (m_nMode == Mode::Unknown && !IncrementalUpdates())
|
||||
return false;
|
||||
|
||||
m_pWriter->AddRedact({});
|
||||
WriteRedact({});
|
||||
m_arrRedact.clear();
|
||||
|
||||
@ -2701,7 +2700,6 @@ bool CPdfEditor::DeletePage(int nPageIndex)
|
||||
if (m_nMode == Mode::Unknown && !IncrementalUpdates())
|
||||
return false;
|
||||
|
||||
m_pWriter->AddRedact({});
|
||||
WriteRedact({});
|
||||
m_arrRedact.clear();
|
||||
|
||||
@ -2730,7 +2728,6 @@ bool CPdfEditor::AddPage(int nPageIndex)
|
||||
if (m_nMode == Mode::Unknown && !IncrementalUpdates())
|
||||
return false;
|
||||
|
||||
m_pWriter->AddRedact({});
|
||||
WriteRedact({});
|
||||
m_arrRedact.clear();
|
||||
|
||||
@ -2765,7 +2762,6 @@ bool CPdfEditor::AddPage(int nPageIndex)
|
||||
}
|
||||
bool CPdfEditor::MovePage(int nPageIndex, int nPos)
|
||||
{
|
||||
m_pWriter->AddRedact({});
|
||||
WriteRedact({});
|
||||
m_arrRedact.clear();
|
||||
|
||||
@ -3318,7 +3314,6 @@ bool CPdfEditor::EditWidgets(IAdvancedCommand* pCommand)
|
||||
if (m_nMode == Mode::Unknown && !IncrementalUpdates())
|
||||
return false;
|
||||
|
||||
m_pWriter->AddRedact({});
|
||||
WriteRedact({});
|
||||
m_arrRedact.clear();
|
||||
|
||||
@ -3633,10 +3628,21 @@ std::vector<double> CPdfEditor::WriteRedact(const std::vector<std::wstring>& arr
|
||||
double B = ret / 100000.0;
|
||||
LONG lColor = (LONG)(((LONG)(R * 255)) | ((LONG)(G * 255) << 8) | ((LONG)(B * 255) << 16) | ((LONG)255 << 24));
|
||||
|
||||
m_pWriter->AddRedact({});
|
||||
double dM1, dM2, dM3, dM4, dM5, dM6;
|
||||
m_pWriter->GetTransform(&dM1, &dM2, &dM3, &dM4, &dM5, &dM6);
|
||||
LONG lType, lColorB, lAlpha1, lAlpha2;
|
||||
m_pWriter->get_BrushType(&lType);
|
||||
m_pWriter->get_BrushColor1(&lColorB);
|
||||
m_pWriter->get_BrushAlpha1(&lAlpha1);
|
||||
m_pWriter->get_BrushAlpha2(&lAlpha2);
|
||||
|
||||
m_pWriter->SetTransform(1, 0, 0, 1, 0, 0);
|
||||
m_pWriter->PathCommandEnd();
|
||||
m_pWriter->put_BrushType(c_BrushTypeSolid);
|
||||
m_pWriter->put_BrushColor1(lColor);
|
||||
m_pWriter->put_BrushAlpha1(255);
|
||||
m_pWriter->put_BrushAlpha2(255);
|
||||
|
||||
for (int i = 0; i < oRedact.arrQuads.size(); i += 8)
|
||||
{
|
||||
@ -3650,6 +3656,12 @@ std::vector<double> CPdfEditor::WriteRedact(const std::vector<std::wstring>& arr
|
||||
m_pWriter->DrawPath(NULL, L"", c_nWindingFillMode);
|
||||
m_pWriter->PathCommandEnd();
|
||||
|
||||
m_pWriter->SetTransform(dM1, dM2, dM3, dM4, dM5, dM6);
|
||||
m_pWriter->put_BrushType(lType);
|
||||
m_pWriter->put_BrushColor1(lColorB);
|
||||
m_pWriter->put_BrushAlpha1(lAlpha1);
|
||||
m_pWriter->put_BrushAlpha2(lAlpha2);
|
||||
|
||||
// TODO рендер редакта должен быть пересечён со всеми последующими редактами
|
||||
// TODO на самом деле должен быть рендер команд редакта
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user