Commit b4ca8fe3 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander Trofimov

Отменена непонятная заливка 62729, из-за которой текст в emf рисовался не там...

Отменена  непонятная заливка 62729, из-за которой текст в emf рисовался не там где надо. Исправлен баг с неправильными углами команды ArcTo в Wmf.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63186 954022d7-b5bf-4e40-9824-e11837661b57
parent b570f4b6
......@@ -511,8 +511,8 @@ namespace MetaFile
if (m_pOutput)
{
double dX = nX, dY = nY;
//TranslatePoint(nX, nY, dX, dY);
double dX, dY;
TranslatePoint(nX, nY, dX, dY);
double* pdDx = NULL;
if (pnDx)
......@@ -526,8 +526,8 @@ namespace MetaFile
for (unsigned int unCharIndex = 0; unCharIndex < unCharsCount; unCharIndex++)
{
int nX1 = nCurX + pnDx[unCharIndex];
double dX1 = nX1, dY1 = nY;
//TranslatePoint(nX1, nY, dX1, dY1);
double dX1, dY1;
TranslatePoint(nX1, nY, dX1, dY1);
pdDx[unCharIndex] = dX1 - dCurX;
nCurX = nX1;
dCurX = dX1;
......
......@@ -376,6 +376,10 @@ namespace MetaFile
unsigned int unReadedSize = m_oStream.Tell() - m_unRecordPos;
return (m_unRecordSize - unReadedSize);
}
inline double GetSweepAngle(const double& dStartAngle, const double& dEndAngle)
{
return (dEndAngle - dStartAngle) - 360;
}
void MoveTo(short shX, short shY)
{
if (m_pOutput)
......@@ -936,10 +940,8 @@ namespace MetaFile
short shYEndArc, shXEndArc, shYStartArc, shXStartArc, shBottom, shRight, shTop, shLeft;
m_oStream >> shYEndArc >> shXEndArc >> shYStartArc >> shXStartArc >> shBottom >> shRight >> shTop >> shLeft;
double dStartAngle = GetEllipseAngle((int)shLeft, (int)shTop, (int)shRight, (int)shBottom, (int)shXStartArc, (int)shYStartArc);
double dSweepAngle = GetEllipseAngle((int)shLeft, (int)shTop, (int)shRight, (int)shBottom, (int)shXEndArc, (int)shYEndArc) - dStartAngle;
if (dSweepAngle <= 0)
dSweepAngle += 360;
double dEndAngle = GetEllipseAngle((int)shLeft, (int)shTop, (int)shRight, (int)shBottom, (int)shXEndArc, (int)shYEndArc);
double dSweepAngle = GetSweepAngle(dStartAngle, dEndAngle);
m_pDC->SetCurPos(shXStartArc, shYStartArc);
ArcTo(shLeft, shTop, shRight, shBottom, dStartAngle, dSweepAngle);
......@@ -951,10 +953,8 @@ namespace MetaFile
short shYEndArc, shXEndArc, shYStartArc, shXStartArc, shBottom, shRight, shTop, shLeft;
m_oStream >> shYEndArc >> shXEndArc >> shYStartArc >> shXStartArc >> shBottom >> shRight >> shTop >> shLeft;
double dStartAngle = GetEllipseAngle((int)shLeft, (int)shTop, (int)shRight, (int)shBottom, (int)shXStartArc, (int)shYStartArc);
double dSweepAngle = GetEllipseAngle((int)shLeft, (int)shTop, (int)shRight, (int)shBottom, (int)shXEndArc, (int)shYEndArc) - dStartAngle;
if (dSweepAngle <= 0)
dSweepAngle += 360;
double dEndAngle = GetEllipseAngle((int)shLeft, (int)shTop, (int)shRight, (int)shBottom, (int)shXEndArc, (int)shYEndArc);
double dSweepAngle = GetSweepAngle(dStartAngle, dEndAngle);
MoveTo(shXStartArc, shYStartArc);
ArcTo(shLeft, shTop, shRight, shBottom, dStartAngle, dSweepAngle);
......@@ -1080,7 +1080,8 @@ namespace MetaFile
m_oStream >> shB >> shR >> shT >> shL;
double dStartAngle = GetEllipseAngle(shL, shT, shR, shB, shXRadial1, shYRadial1);
double dSweepAngle = GetEllipseAngle(shL, shT, shR, shB, shXRadial2, shYRadial2) - dStartAngle;
double dEndAngle = GetEllipseAngle(shL, shT, shR, shB, shXRadial2, shYRadial2);
double dSweepAngle = GetSweepAngle(dStartAngle, dEndAngle);
short shCenterX = (shL + shR) / 2;
short shCenterY = (shT + shB) / 2;
......@@ -1185,7 +1186,7 @@ namespace MetaFile
MoveTo(shL + shW, shT);
LineTo(shR - shW, shT);
ArcTo(shR - shW, shT, shR, shT + shH, -90, 90);
ArcTo(shR - shW, shT, shR, shT + shH, 270, 90);
LineTo(shR, shB - shH);
ArcTo(shR - shW, shB - shH, shR, shB, 0, 90);
LineTo(shL + shW, shB);
......
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