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

к предыдущей заливке (56614)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56616 954022d7-b5bf-4e40-9824-e11837661b57
parent 6d86d906
......@@ -20,6 +20,7 @@ function ParaMath()
//this.Root = this.Math.Root;
this.Root = new CMathContent();
this.Root.bRoot = true;
//this.Root.setComposition(this);
this.X = 0;
......@@ -408,6 +409,8 @@ ParaMath.prototype =
this.StartLine = StartLine;
this.StartRange = StartRange;
this.LinesLength = 0;
this.Root.Recalculate_Reset(StartRange, StartLine);
},
Recalculate_Range : function(PRS, ParaPr, Depth)
......@@ -1014,7 +1017,6 @@ ParaMath.prototype =
this.bSelectionUse = true;
this.Root.Set_Select_ToMComp(Direction);
//console.log("bSelectionUse : " + this.bSelectionUse);
},
//-----------------------------------------------------------------------------------
// Функции отрисовки
......@@ -1348,8 +1350,11 @@ ParaMath.prototype =
SelectionDraw.StartX += oCont.pos.x + oCont.WidthToElement[Start];
if(Start == End)
{
oCont.content[Start].Selection_DrawRange(0, 0, SelectionDraw);
}
else
{
oCont.content[Start].Selection_DrawRange(0, 0, SelectionDraw);
......@@ -1377,6 +1382,7 @@ ParaMath.prototype =
}
}
},
Selection_IsEmpty : function(CheckEnd)
......
......@@ -7168,37 +7168,56 @@ ParaRun.prototype.Math_Recalculate = function(Parent, Paragraph, oMeasure, Recal
var width = 0,
ascent = 0, descent = 0;
var oWPrp = this.Get_CompiledPr(true);
if(TXT_NORMAL !== this.Math_GetTypeText()) // выставляем false, чтобы не применился наклон к спец символам
oWPrp.Italic = false;
g_oTextMeasurer.SetFont(oWPrp);
for (var Pos = 0 ; Pos < this.Content.length; Pos++ )
{
this.Content[Pos].Resize(this, oMeasure);
this.Content[Pos].ApplyGaps();
RecalcInfo.leftRunPrp = RecalcInfo.currRunPrp;
RecalcInfo.Left = RecalcInfo.Current;
var oSize = this.Content[Pos].size;
width += oSize.width;
RecalcInfo.currRunPrp = oWPrp;
RecalcInfo.Current = this.Content[Pos];
RecalcInfo.setGaps();
ascent = ascent > oSize.ascent ? ascent : oSize.ascent;
var oDescent = oSize.height - oSize.ascent;
descent = descent < oDescent ? oDescent : descent;
this.Content[Pos].Resize(this, oMeasure);
}
var oSize = this.Content[Pos].size;
width += oSize.width;
/*if(this.Parent.bRoot)
{
var lng = this.Content.length;
for(var i = 0; i < lng; i++)
{
var left = this.Content[i].GapLeft,
right = this.Content[i].GapRight;
ascent = ascent > oSize.ascent ? ascent : oSize.ascent;
var oDescent = oSize.height - oSize.ascent;
descent = descent < oDescent ? oDescent : descent;
console.log(RecalcInfo.TEST_COUNT + ". Left : " + left + ", Right : " + right);
}
RecalcInfo.TEST_COUNT++;
}
}*/
this.size = {width: width, height: ascent + descent, ascent: ascent};
}
/*ParaRun.prototype.ApplyGaps = function()
{
if(this.Is_Empty() == false)
{
var lng = this.Content.length;
this.Content[lng - 1].ApplyGaps();
this.size.width += this.Content[lng - 1].size.width;
}
}*/
ParaRun.prototype.Math_Update_Cursor = function(X, Y, CurPage, UpdateTarget)
{
var runPrp = this.Get_CompiledPr(true);
......@@ -7235,4 +7254,25 @@ ParaRun.prototype.getPropsForWrite = function()
mathRPrp = this.MathPrp.getPropsForWrite();
return {wRPrp: wRPrp, mathRPrp: mathRPrp};
}
ParaRun.prototype.Math_SetGaps = function(Paragraph, RecalcInfo)
{
this.Paragraph = Paragraph;
var oWPrp = this.Get_CompiledPr(true);
if(TXT_NORMAL !== this.Math_GetTypeText()) // выставляем false, чтобы не применился наклон к спец символам
oWPrp.Italic = false;
g_oTextMeasurer.SetFont(oWPrp);
for (var Pos = 0 ; Pos < this.Content.length; Pos++ )
{
RecalcInfo.leftRunPrp = RecalcInfo.currRunPrp;
RecalcInfo.Left = RecalcInfo.Current;
RecalcInfo.currRunPrp = oWPrp;
RecalcInfo.Current = this.Content[Pos];
RecalcInfo.setGaps();
}
}
\ No newline at end of file
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