Merge pull request 'Fix bug 78932' (#598) from fix/bug-78932 into release/v9.3.0

Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/598
This commit is contained in:
Oleg Korshul
2026-01-15 10:30:23 +00:00
3 changed files with 11 additions and 3 deletions

View File

@ -193,14 +193,17 @@ namespace NSDocxRenderer
if (!m_arShapes.empty())
{
auto& last_shape = m_arShapes.back();
if (last_shape->IsEqual(top, bot, left, right) && rotation == last_shape->m_dRotation)
auto& last_shape = m_arShapes.back();
if (last_shape->IsEqual(top, bot, left, right) && rotation == last_shape->m_dRotation && lType != m_lLastType && m_lLastType != 0)
{
set_fill_mode(last_shape);
// Reset stroke/fill logic
m_lLastType = 0;
return;
}
}
m_lLastType = lType;
auto shape = std::make_shared<CShape>();
shape->m_oPen.Size *= transform_det;
set_fill_mode(shape);

View File

@ -231,6 +231,8 @@ namespace NSDocxRenderer
std::vector<shape_ptr_t> m_arLuminosityShapes;
std::vector<shape_ptr_t> m_arOneColorGradientShape;
long m_lLastType = 0;
size_t m_nCurrentOrder = 0;
};
}

View File

@ -178,7 +178,10 @@ namespace NSDocxRenderer
}
bool CBaseItem::IsEqual(double dTop, double dBot, double dLeft, double dRight) const noexcept
{
return m_dLeft == dLeft && m_dTop == dTop && m_dBot == dBot && m_dRight == dRight;
return fabs(m_dLeft - dLeft) < c_dGRAPHICS_ERROR_MM &&
fabs(m_dTop - dTop) < c_dGRAPHICS_ERROR_MM &&
fabs(m_dBot - dBot) < c_dGRAPHICS_ERROR_MM &&
fabs(m_dRight - dRight) < c_dGRAPHICS_ERROR_MM;
}
bool CBaseItem::operator==(const CBaseItem& other)
{