Fix bug#72243

This commit is contained in:
Green
2024-12-24 13:07:45 +03:00
parent cc2867e292
commit c472b19e0d
2 changed files with 16 additions and 1 deletions

View File

@ -33,7 +33,8 @@ namespace MetaFile
return;
std::swap(m_pParser, m_oSecondConditional.m_pParser);
std::swap(m_oClip, m_oSecondConditional.m_oClip);
SwapClips(m_oClip, m_oSecondConditional.m_oClip);
}
InterpretatorType CEmfInterpretatorSvg::GetType() const
@ -1046,6 +1047,7 @@ namespace MetaFile
void CEmfInterpretatorSvg::HANDLE_EMR_FRAMERGN(const TRectL &oBounds, unsigned int unIhBrush, int nWidth, int nHeight, const TRegionDataHeader &oRegionDataHeader, const std::vector<TRectL> &arRects)
{
m_bUpdatedClip = false;
}
void CEmfInterpretatorSvg::HANDLE_EMFPLUS_OFFSETCLIP(double dX, double dY)
@ -1493,6 +1495,17 @@ namespace MetaFile
CInterpretatorSvgBase::PathClip(oPath, nClipMode, pTransform);
}
void CEmfInterpretatorSvg::SwapClips(CSvgClip& oFirstClip, CSvgClip& oSecondClip)
{
if (oFirstClip.StartedClip())
WriteNodeEnd(L"g");
if (oSecondClip.StartedClip())
WriteNodeBegin(L"g", {{L"clip-path", L"url(#" + oSecondClip.GetClipId() + L')'}});
std::swap(oFirstClip, oSecondClip);
}
TRectD CEmfInterpretatorSvg::TranslateRect(const TRectL &oRect) const
{
TRectD oNewRect(oRect.Left, oRect.Top, oRect.Right, oRect.Bottom);

View File

@ -226,6 +226,8 @@ namespace MetaFile
void SetTransform(double& dM11, double& dM12, double& dM21, double& dM22, double& dX, double& dY) override {};
void GetTransform(double* pdM11, double* pdM12, double* pdM21, double* pdM22, double* pdX, double* pdY) override {};
void SwapClips(CSvgClip& oFirstClip, CSvgClip& oSecondClip);
TRectD TranslateRect(const TRectL &oRect) const;
};
}