mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Add offset for brush rect
This commit is contained in:
@ -622,6 +622,12 @@ HRESULT CGraphicsRenderer::BrushRect(const INT& val, const double& left, const d
|
||||
m_oBrush.Rect.Height = (float)height;
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CGraphicsRenderer::get_BrushRect(Aggplus::RectF& rect, bool& rectable) const
|
||||
{
|
||||
rectable = m_oBrush.Rectable;
|
||||
rect = m_oBrush.Rect;
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CGraphicsRenderer::BrushBounds(const double& left, const double& top, const double& width, const double& height)
|
||||
{
|
||||
m_oBrush.Bounds.left = left;
|
||||
|
||||
@ -190,6 +190,7 @@ public:
|
||||
virtual HRESULT get_BrushTransform(Aggplus::CMatrix& oMatrix);
|
||||
virtual HRESULT put_BrushTransform(const Aggplus::CMatrix& oMatrix);
|
||||
virtual HRESULT BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height);
|
||||
virtual HRESULT get_BrushRect(Aggplus::RectF& rect, bool& rectable) const;
|
||||
virtual HRESULT BrushBounds(const double& left, const double& top, const double& width, const double& height);
|
||||
virtual HRESULT put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount);
|
||||
|
||||
|
||||
@ -243,6 +243,7 @@ public:
|
||||
virtual HRESULT get_BrushLinearAngle(double* dAngle) = 0;
|
||||
virtual HRESULT put_BrushLinearAngle(const double& dAngle) = 0;
|
||||
virtual HRESULT BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height) = 0;
|
||||
virtual HRESULT get_BrushRect(Aggplus::RectF& rect, bool& rectable) const = 0;
|
||||
virtual HRESULT BrushBounds(const double& left, const double& top, const double& width, const double& height) = 0;
|
||||
|
||||
virtual HRESULT put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount) = 0;
|
||||
|
||||
@ -664,9 +664,20 @@ namespace NSOnlineOfficeBinToPdf
|
||||
}
|
||||
case ctPathCommandOffset:
|
||||
{
|
||||
isClip = true;
|
||||
|
||||
double m1 = oReader.ReadDouble();
|
||||
double m2 = oReader.ReadDouble();
|
||||
isClip = true;
|
||||
|
||||
Aggplus::RectF rect;
|
||||
bool rectable;
|
||||
pRenderer->get_BrushRect(rect, rectable);
|
||||
if (rectable)
|
||||
{
|
||||
rect.Offset(m1, m2);
|
||||
pRenderer->BrushRect(true, rect.X, rect.Y, rect.Width, rect.Height);
|
||||
}
|
||||
|
||||
clipPath = path.Trsanslate(m1, m2);
|
||||
}
|
||||
case ctDrawPath:
|
||||
|
||||
@ -212,6 +212,19 @@ public:
|
||||
void Offset(const PointF_T<T>& point) { Offset(point.X, point.Y); }
|
||||
void Offset(T dx, T dy) { X += dx; Y += dy; }
|
||||
|
||||
RectF_T& operator=(const RectF_T& other)
|
||||
{
|
||||
if (this == &other)
|
||||
return *this;
|
||||
|
||||
X = other.X;
|
||||
Y = other.Y;
|
||||
Width = other.Width;
|
||||
Height = other.Height;
|
||||
|
||||
return *this;
|
||||
};
|
||||
|
||||
public:
|
||||
T X, Y, Width, Height;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user