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

1. Поправила выравнивание итераторов для степени в случае, когда в основании...

1. Поправила выравнивание итераторов для степени в случае, когда в основании Function (ориентируемя на первый элемент в аргументе)
2. Поправила  для инлайновых N-арных операторов расстояния между оператором и итераторами

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60386 954022d7-b5bf-4e40-9824-e11837661b57
parent 5984cda6
......@@ -1431,6 +1431,10 @@ CMathBase.prototype.GetLastElement = function()
{
return this;
};
CMathBase.prototype.GetFirstElement = function()
{
return this;
};
CMathBase.prototype.private_UpdatePosOnAdd = CMathContent.prototype.private_UpdatePosOnAdd;
CMathBase.prototype.private_UpdatePosOnRemove = CMathContent.prototype.private_UpdateOnRemove;
......
......@@ -44,6 +44,8 @@ function CDegreeBase(props, bInside)
this.baseContent = null;
this.iterContent = null;
this.bNaryInline = false;
if(props !== null && typeof(props) !== "undefined")
this.init(props);
//CDegreeBase.prototype.init.call(this, props);
......@@ -80,6 +82,8 @@ CDegreeBase.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsI
var RPIDegr = RPI.Copy();
RPIDegr.bDecreasedComp = true;
this.bNaryInline = RPI.bNaryInline;
this.iterContent.PreRecalc(this, ParaMath, ArgSzDegr, RPIDegr);
}
CDegreeBase.prototype.Resize = function(oMeasure, RPI)
......@@ -172,11 +176,10 @@ CDegreeBase.prototype.recalculateSup = function(oMeasure)
var height = this.upBase + base.height;
var ascent = this.upBase + base.ascent;
// only for supScript
if(this.IsPlhIterator())
this.dW = 0.008*mgCtrPrp.FontSize;
if( this.bNaryInline)
this.dW = 0.17*PlH;
else
this.dW = 0.01*mgCtrPrp.FontSize;
this.dW = 0.056*PlH;
var width = base.width + iter.width + this.dW;
width += this.GapLeft + this.GapRight;
......@@ -191,8 +194,6 @@ CDegreeBase.prototype.recalculateSubScript = function(oMeasure)
var mgCtrPrp = this.Get_TxtPrControlLetter();
var shCenter = this.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp);
var width = base.width + iter.width + this.dW;
width += this.GapLeft + this.GapRight;
//var oBase = this.elements[0][0];
//var bOneLineText = oBase.IsJustDraw() ? false : oBase.IsOneLineText();
......@@ -213,12 +214,13 @@ CDegreeBase.prototype.recalculateSubScript = function(oMeasure)
var height, ascent, descent;
var PlH = 0.64*this.ParaMath.GetPlh(oMeasure, mgCtrPrp);
if(bTextElement)
{
//var last = lastElem.size;
var DownBaseline = 0.9*shCenter;
var PlH = 0.64*this.ParaMath.GetPlh(oMeasure, mgCtrPrp);
if(iter.ascent - DownBaseline > 3/4*PlH)
this.upIter = 1/4*PlH;
......@@ -252,6 +254,14 @@ CDegreeBase.prototype.recalculateSubScript = function(oMeasure)
ascent = base.ascent;
}
if( this.bNaryInline)
this.dW = 0.17*PlH;
else
this.dW = 0.056*PlH;
var width = base.width + iter.width + this.dW;
width += this.GapLeft + this.GapRight;
this.size = {width: width, height: height, ascent: ascent};
};
CDegreeBase.prototype.setPosition = function(pos, PosInfo)
......@@ -519,7 +529,7 @@ CDegreeSubSupBase.prototype.recalculateSize = function(oMeasure, RPI)
var shCenter = this.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp);
shCenter *= 1.4;
var ctrPrpIter = this.iters.Get_TxtPrControlLetter();
//var ctrPrpIter = this.iters.Get_TxtPrControlLetter();
//var shIter = this.ParaMath.GetShiftCenter(oMeasure, ctrPrpIter); //смещение
var PlH = 0.26*this.ParaMath.GetPlh(oMeasure, mgCtrPrp);
......@@ -608,6 +618,11 @@ CDegreeSubSupBase.prototype.recalculateSize = function(oMeasure, RPI)
this.iters.recalculateSize(oMeasure, dH, ascent/*ascent of Iterators*/);
}
if( this.bNaryInline)
this.dW = 0.42*PlH;
else
this.dW = 0.14*PlH;
width = this.iters.size.width + base.width + this.dW;
width += this.GapLeft + this.GapRight;
......
......@@ -218,7 +218,11 @@ CMathFunc.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInf
};
CMathFunc.prototype.GetLastElement = function()
{
return this.Content[1].GetLastElement();
return this.Content[1].GetFirstElement();
};
CMathFunc.prototype.GetFirstElement = function()
{
return this.Content[0].GetFirstElement();
};
CMathFunc.prototype.setDistance = function()
{
......
......@@ -1848,6 +1848,20 @@ CMathContent.prototype =
return last;
},
GetFirstElement: function()
{
var pos = 0;
while(this.Content[pos].Type == para_Math_Run && this.Content[pos].Is_Empty() && pos < this.Content.length - 1)
{
pos++;
}
var first = this.Content[pos].Type == para_Math_Run ? this.Content[pos] : this.Content[pos].GetFirstElement();
return first;
},
////////////////////////////////////////////////////////////////
......
......@@ -3772,6 +3772,23 @@ CDelimiter.prototype.GetLastElement = function()
return Result;
};
CDelimiter.prototype.GetFirstElement = function()
{
var Result;
var IsStrartOper = this.begOper.typeOper !== OPERATOR_EMPTY;
var growLast = IsStrartOper && this.Pr.grow == true && this.TextInContent,
smallLast = IsStrartOper && this.Pr.grow == false;
if(growLast || smallLast || this.begOper.typeOper == OPERATOR_TEXT)
{
Result = this.begOper;
}
else
Result = this;
return Result;
};
function CCharacter()
......
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