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

Исправлен баг с начальным значением параметра прилегания текста. Исправлен баг...

Исправлен баг с начальным значением параметра прилегания текста. Исправлен баг с рассчетом прилегания текста.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62256 954022d7-b5bf-4e40-9824-e11837661b57
parent d7f86d41
...@@ -223,7 +223,7 @@ namespace MetaFile ...@@ -223,7 +223,7 @@ namespace MetaFile
m_oInverseTransform.Init(); m_oInverseTransform.Init();
m_oTextColor.Init(); m_oTextColor.Init();
m_oBgColor.Init(); m_oBgColor.Init();
m_ulTextAlign = TA_BASELINE | TA_LEFT | TA_NOUPDATECP; m_ulTextAlign = TA_TOP | TA_LEFT | TA_NOUPDATECP;
m_ulBgMode = TRANSPARENT; m_ulBgMode = TRANSPARENT;
m_ulMiterLimit = 0; m_ulMiterLimit = 0;
m_ulFillMode = WINDING; m_ulFillMode = WINDING;
......
...@@ -141,6 +141,9 @@ namespace MetaFile ...@@ -141,6 +141,9 @@ namespace MetaFile
{ {
pFontManager->LoadFontByName(wsFaceName, dFontHeight, lStyle, 72, 72); pFontManager->LoadFontByName(wsFaceName, dFontHeight, lStyle, 72, 72);
pFontManager->LoadString1(wsText, 0, 0); pFontManager->LoadString1(wsText, 0, 0);
double dFHeight = dFontHeight * pFontManager->m_pFont->GetHeight() / pFontManager->m_pFont->m_lUnits_Per_Em * 25.4 / 72;
double dFDescent = dFontHeight * pFontManager->m_pFont->GetDescender() / pFontManager->m_pFont->m_lUnits_Per_Em * 25.4 / 72;
double dFAscent = dFHeight - std::abs(dFDescent);
TBBox oBox = pFontManager->MeasureString2(); TBBox oBox = pFontManager->MeasureString2();
fL = oBox.fMinX; fL = oBox.fMinX;
fT = oBox.fMinY; fT = oBox.fMinY;
...@@ -155,6 +158,17 @@ namespace MetaFile ...@@ -155,6 +158,17 @@ namespace MetaFile
fW *= (float)fKoef; fW *= (float)fKoef;
fH *= (float)fKoef; fH *= (float)fKoef;
if (std::abs(fT) < dFAscent)
{
if (fT < 0)
fT = -dFAscent;
else
fT = dFAscent;
}
if (fH < dFHeight)
fH = dFHeight;
fUndX1 *= (float)fKoef; fUndY1 *= (float)fKoef; fUndX1 *= (float)fKoef; fUndY1 *= (float)fKoef;
fUndX2 *= (float)fKoef; fUndY2 *= (float)fKoef; fUndX2 *= (float)fKoef; fUndY2 *= (float)fKoef;
fUndSize *= (float)fKoef / 2; fUndSize *= (float)fKoef / 2;
......
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