Commit cf7b172a authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

Поправлен баг: не учитывались межстрочные интервалы при пересчете LineMetrics формул

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@67561 954022d7-b5bf-4e40-9824-e11837661b57
parent c050be90
...@@ -1792,6 +1792,7 @@ ParaMath.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _Cu ...@@ -1792,6 +1792,7 @@ ParaMath.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _Cu
if(PRS.LineDescent < RootDescent) if(PRS.LineDescent < RootDescent)
PRS.LineDescent = RootDescent; PRS.LineDescent = RootDescent;
this.Root.Math_UpdateLineMetrics(PRS, ParaPr);
}; };
ParaMath.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange) ParaMath.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange)
{ {
......
...@@ -10515,6 +10515,39 @@ ParaRun.prototype.Is_UseInParagraph = function() ...@@ -10515,6 +10515,39 @@ ParaRun.prototype.Is_UseInParagraph = function()
return true; return true;
}; };
ParaRun.prototype.Math_UpdateLineMetrics = function(PRS, ParaPr)
{
var LineRule = ParaPr.Spacing.LineRule;
// Пересчитаем метрику строки относительно размера данного текста
if ( PRS.LineTextAscent < this.TextAscent )
PRS.LineTextAscent = this.TextAscent;
if ( PRS.LineTextAscent2 < this.TextAscent2 )
PRS.LineTextAscent2 = this.TextAscent2;
if ( PRS.LineTextDescent < this.TextDescent )
PRS.LineTextDescent = this.TextDescent;
if ( linerule_Exact === LineRule )
{
// Смещение не учитывается в метриках строки, когда расстояние между строк точное
if ( PRS.LineAscent < this.TextAscent )
PRS.LineAscent = this.TextAscent;
if ( PRS.LineDescent < this.TextDescent )
PRS.LineDescent = this.TextDescent;
}
else
{
if ( PRS.LineAscent < this.TextAscent + this.YOffset )
PRS.LineAscent = this.TextAscent + this.YOffset;
if ( PRS.LineDescent < this.TextDescent - this.YOffset )
PRS.LineDescent = this.TextDescent - this.YOffset;
}
};
function CParaRunStartState(Run) function CParaRunStartState(Run)
{ {
......
...@@ -4326,6 +4326,10 @@ CMathContent.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, ...@@ -4326,6 +4326,10 @@ CMathContent.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine,
ContentMetrics.UpdateMetrics(NewContentMetrics); ContentMetrics.UpdateMetrics(NewContentMetrics);
}; };
CMathContent.prototype.Math_UpdateLineMetrics = function(PRS, ParaPr)
{
this.Content[0].Math_UpdateLineMetrics(PRS, ParaPr); // this.Content[0] - Run
};
CMathContent.prototype.UpdateOperators = function(_CurLine, _CurRange, bEmptyGapLeft, bEmptyGapRight) CMathContent.prototype.UpdateOperators = function(_CurLine, _CurRange, bEmptyGapLeft, bEmptyGapRight)
{ {
var CurLine = _CurLine - this.StartLine; var CurLine = _CurLine - this.StartLine;
......
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