Commit 1a673731 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@54415 954022d7-b5bf-4e40-9824-e11837661b57
parent e351673b
......@@ -1174,7 +1174,7 @@ BOOL CFontFile::GetString2C(CGlyphString& oString)
AddToSizesCache( oSizes );
charSymbolObj = m_arrCacheSizesIndexs[oSizes.ushUnicode];
}
else
if (0xFFFF != charSymbolObj)
{
TFontCacheSizes& oSizes = m_oCacheSizes[charSymbolObj];
int nCMapIndex = oSizes.nCMapIndex;
......
......@@ -50,6 +50,8 @@ CGlyphString::CGlyphString()
m_fTransX = 0;
m_fTransY = 0;
m_dIDet = 1.0;
}
CGlyphString::CGlyphString(const std::wstring& wsString, float fX, float fY)
......
......@@ -520,7 +520,7 @@ namespace Aggplus
}
double dWidth = pPen->Size;
if (0 == dWidth)
if (0 == dWidth && !m_bIntegerGrid)
{
dWidth = 1.0 / sqrt(m_oCoordTransform.m_agg_mtx.determinant());
}
......@@ -534,6 +534,10 @@ namespace Aggplus
c_c_path.approximation_scale(25.0);
c_c_path.approximation_method(agg::curve_inc);
DashStyle eStyle = (DashStyle)pPen->DashStyle;
agg::trans_affine* pAffine = &m_oFullTransform.m_agg_mtx;
if (m_bIntegerGrid)
pAffine = new agg::trans_affine();
if (DashStyleSolid == eStyle)
{
......@@ -554,7 +558,7 @@ namespace Aggplus
typedef agg::conv_transform<Path_Conv_StrokeN> transStroke;
transStroke trans(pgN, m_oFullTransform.m_agg_mtx);
transStroke trans(pgN, *pAffine);
m_rasterizer.get_rasterizer().add_path(trans);
}
else
......@@ -618,7 +622,7 @@ namespace Aggplus
pgD.miter_limit(dblMiterLimit);
pgD.width(dWidth);
agg::conv_transform<Path_Conv_StrokeD> trans(pgD, m_oFullTransform.m_agg_mtx);
agg::conv_transform<Path_Conv_StrokeD> trans(pgD, *pAffine);
m_rasterizer.get_rasterizer().add_path(trans);
}
......@@ -628,6 +632,10 @@ namespace Aggplus
m_rasterizer.get_rasterizer().filling_rule(agg::fill_non_zero);
DoFillPath(&oBrush);
if (m_bIntegerGrid)
RELEASEOBJECT(pAffine);
return Ok;
}
......@@ -757,10 +765,19 @@ namespace Aggplus
agg::path_storage p2(pPath->m_agg_ps);
typedef agg::conv_transform<agg::path_storage> trans_type;
trans_type trans(p2, m_oFullTransform.m_agg_mtx);
trans_type* ptrans = NULL;
agg::trans_affine* paffine = NULL;
if (!m_bIntegerGrid)
ptrans = new trans_type(p2, m_oFullTransform.m_agg_mtx);
else
{
paffine = new agg::trans_affine();
ptrans = new trans_type(p2, *paffine);
}
typedef agg::conv_curve<trans_type> conv_crv_type;
conv_crv_type c_c_path(trans);
conv_crv_type c_c_path(*ptrans);
m_rasterizer.get_rasterizer().add_path(c_c_path);
......@@ -803,6 +820,9 @@ namespace Aggplus
}
DoFillPath(pBrush);
RELEASEOBJECT(ptrans);
RELEASEOBJECT(paffine);
return Ok;
}
......
......@@ -302,7 +302,7 @@ public:
CGraphics();
CGraphics(int dwWidth, int dwHeight, int stride, BYTE* pBuffer);
CGraphics(CImage* pImage);;
CGraphics(CImage* pImage);
~CGraphics();
BOOL IsDib();
......
......@@ -65,6 +65,13 @@ protected:
void UpdateSize();
public:
void SavePen(NSStructures::CPen& oPen) { oPen = m_oPen; }
void RestorePen(const NSStructures::CPen& oPen) { m_oPen = oPen; }
void SaveBrush(NSStructures::CBrush& oBrush) { oBrush = m_oBrush; }
void RestoreBrush(const NSStructures::CBrush& oBrush) { m_oBrush = oBrush; }
public:
// -----------------------------------------------------------------------------
virtual HRESULT get_Type(LONG* lType);
......@@ -186,7 +193,7 @@ public:
virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand);
void put_GlobalAlphaEnabled(const bool& bEnabled, const double& dVal);
inline void put_IntegerGrid(const bool& bEnabled)
inline void put_IntegerGrid(const bool& bEnabled)
{
if (!m_pRenderer)
return;
......@@ -215,6 +222,10 @@ public:
{
return m_pRenderer->GetFullTransform();
}
inline Aggplus::CMatrix* GetTransformMatrix()
{
return m_pRenderer->GetTransform();
}
inline void SetCoordTransformOffset(double dOffsetX, double dOffsetY)
{
Aggplus::CMatrix* pCoord = m_pRenderer->GetCoordTransform();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment