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

1. Сделала выравнивание итератора в CLimit по бейзлайну

2. Учитываем знак параграфа для выравнивания с помощью амперсандов в EqArray

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58450 954022d7-b5bf-4e40-9824-e11837661b57
parent d87dc694
......@@ -2803,7 +2803,14 @@ ParaRun.prototype.Refresh_RecalcData = function(Data)
{
var Para = this.Paragraph;
if ( -1 !== this.StartLine && undefined !== Para )
if(this.Type == para_Math_Run)
{
if(this.Parent !== null && this.Parent !== undefined)
{
this.Parent.Refresh_RecalcData();
}
}
else if ( -1 !== this.StartLine && undefined !== Para )
{
var CurLine = this.StartLine;
......@@ -7853,8 +7860,8 @@ ParaRun.prototype.Math_Recalculate = function(oMeasure, Parent, Paragraph, RPI,
this.protected_AddRange(0, 0);
this.protected_FillRange(0, 0, RangeStartPos, RangeEndPos);
var oWPrp = this.Get_CompiledPr(true);
this.Parent.ParaMath.ApplyArgSize(oWPrp, ArgSize.value);
if(!this.IsNormalText()) // выставляем false, чтобы не применился наклон к спец символам
......@@ -7871,6 +7878,7 @@ ParaRun.prototype.Math_Recalculate = function(oMeasure, Parent, Paragraph, RPI,
g_oTextMeasurer.SetFont(oWPrp);
this.bEqqArray = RPI.bEqqArray;
......
......@@ -345,7 +345,7 @@ CMathBase.prototype =
{
return this.Parent.remove(order);
},
recalculateSize: function(oMeasure)
recalculateSize: function(oMeasure, RPI)
{
var width = 0;
var height = 0;
......@@ -367,7 +367,7 @@ CMathBase.prototype =
width += this.dW*(this.nCol - 1) + this.GapLeft + this.GapRight;
var ascent = this.getAscent(oMeasure, height);
var ascent = this.getAscent(oMeasure, height, RPI);
this.size = {width: width, height: height, ascent: ascent};
},
......
......@@ -390,7 +390,6 @@ CFraction.prototype.fillMathComposition = function(props, contents /*array*/)
this.setProperties(props);
this.fillContent();
if(this.Pr.type == BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION)
{
// Numerator
......@@ -481,6 +480,17 @@ CNumerator.prototype.init = function()
this.setDimension(1, 1);
this.setContent();
}
CNumerator.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
this.ArgSize = ArgSize.Copy();
this.elements[0][0].Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.recalculateSize();
}
CNumerator.prototype.recalculateSize = function()
{
var arg = this.elements[0][0].size;
......@@ -525,9 +535,10 @@ CNumerator.prototype.getPropsForWrite = function()
return props;
}
function CDenominator()
function CDenominator(bLimit)
{
this.gap = 0;
this.bLimit = bLimit == true;
CMathBase.call(this, true);
......@@ -539,17 +550,33 @@ CDenominator.prototype.init = function()
this.setDimension(1, 1);
this.setContent();
}
CDenominator.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
this.ArgSize = ArgSize.Copy();
this.elements[0][0].Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.recalculateSize();
}
CDenominator.prototype.recalculateSize = function()
{
var arg = this.elements[0][0].size;
var mgCtrPrp = this.Get_CompiledCtrPrp();
var gapDen = 7.325682539682539 * mgCtrPrp.FontSize/36,
Ascent = arg.ascent - 4.938888888888888*mgCtrPrp.FontSize/36,
minGap = gapDen/3;
if(this.bLimit)
{
gapDen /= 1.5;
minGap /= 1.5;
}
var delta = gapDen - Ascent;
this.gap = delta > minGap ? delta : minGap;
......
......@@ -6,8 +6,8 @@ function CLimit(props)
this.kind = MATH_LIMIT;
this.FName = new CMathContent();
this.Iterator = new CMathContent();
this.ContentFName = new CMathContent();
this.ContentIterator = new CMathContent();
this.Pr =
{
......@@ -29,15 +29,13 @@ CLimit.prototype.init = function(props)
}
CLimit.prototype.getFName = function()
{
return this.FName;
//return this.FName;
return this.ContentFName;
}
CLimit.prototype.getIterator = function()
{
return this.Iterator;
}
CLimit.prototype.setDistance = function()
{
this.dH = 0.03674768518518519*this.Get_CompiledCtrPrp().FontSize;
//return this.Iterator;
return this.ContentIterator;
}
CLimit.prototype.setProperties = function(props)
{
......@@ -50,8 +48,11 @@ CLimit.prototype.fillMathComposition = function(props, contents /*array*/)
{
this.setProperties(props);
this.FName = contents[0];
this.Iterator = contents[1];
this.FName = null;
this.Iterator = null;
this.ContentFName = contents[0];
this.ContentIterator = contents[1];
this.RecalcInfo.bProps = true;
}
......@@ -88,7 +89,10 @@ CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
}
this.elements[0][0] = new CDegree(null, true);
this.elements[0][0].fillMathComposition(props, [this.FName, this.Iterator]);
this.elements[0][0].fillMathComposition(props, [this.ContentFName, this.ContentIterator]);
this.FName = this.ContentFName;
this.Iterator = this.ContentIterator;
}
else
{
......@@ -96,11 +100,20 @@ CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
if(this.Pr.type == LIMIT_LOW)
{
this.FName = this.ContentFName;
//this.elements[1][0] = this.Iterator;
this.Iterator = new CDenominator(true);
this.Iterator.fillMathComposition(this.ContentIterator);
this.elements[0][0] = this.FName;
this.elements[1][0] = this.Iterator;
}
else
{
this.FName = this.ContentFName;
this.Iterator = this.ContentIterator;
this.elements[0][0] = this.Iterator;
this.elements[1][0] = this.FName;
}
......@@ -131,18 +144,21 @@ CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
this.Iterator.Resize(oMeasure, this, ParaMath, RPI, ArgSzIter);
var SizeFName = this.FName.size,
SizeIter = this.Iterator.size;
var width = SizeFName.width > SizeIter.width ? SizeFName.width : SizeIter.width,
height = SizeFName.height + SizeIter.height + this.dH,
height = SizeFName.height + SizeIter.height,
ascent;
if(this.Pr.type == LIMIT_LOW)
{
ascent = SizeFName.ascent;
}
else if(this.Pr.type == LIMIT_UP)
{
ascent = SizeIter.height + this.dH + SizeFName.ascent;
}
width += this.GapLeft + this.GapRight;
......
......@@ -763,7 +763,7 @@ CMathAmp.prototype =
{
if(this.bEqqArray==false)
this.AmpText.draw(x, y, pGraphics);
else
else if(editor.ShowParaMarks) // показать метки выравнивания, если включена отметка о знаках параграфа
{
var X = x + this.pos.x,
Y = y + this.pos.y,
......
......@@ -614,7 +614,6 @@ CNaryUndOvr.prototype.recalculateSize = function()
var FontSize = this.Get_CompiledCtrPrp().FontSize;
var zetta = FontSize*25.4/96;
this.gapTop = zetta*0.25;
//this.gapBottom = zetta*0.1;
var minGapBottom = zetta*0.1,
DownBaseline = FontSize*0.23;
......
This diff is collapsed.
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