Commit dcc82cab authored by Anna.Pavlova's avatar Anna.Pavlova

1. Реализовала функцию для мержа текстовых настроек для управляющих элементов...

1. Реализовала функцию для мержа текстовых настроек для управляющих элементов объектов (текстовые свойства для управляющих элементов зависят от тестовых настроек первого Run)
2. На Resize сначала компилируем ArgSize каждого контента, TxtPrp для управляющих элементов и CtrPrp, вычисляем Gaps, затем делаем Recalculate
3. Поправила баг : при запросе Get_CompiledTextPr менялись скомпилированные настройки у пустого рана (из-за этого было падение при смене размера шрифта из меню)
4. Поправила свойство Delimiters при чтении файла
5. При добавлении сложных объектов (n-арных объектов, дробей и др) в итераторы N-арных операторов, итераторы степеней
6. Поправила баг : когда ctrPrp у степени больше TxtPrp итераторов, итераторы разъезжались у DegreeSupSub (беру смерженные ctrPrp для плейсхолдеров)
7. На Split матрицы копирую св-во Jc


git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58950 954022d7-b5bf-4e40-9824-e11837661b57
parent 635d70c9
......@@ -58,7 +58,7 @@ function ParaMath()
this.DefaultTextPr = new CTextPr();
this.DefaultTextPr.Italic = true;
this.DefaultTextPr.FontSize = 11;
this.DefaultTextPr.FontFamily = {Name : "Cambria Math", Index : -1 };
this.DefaultTextPr.RFonts.Set_All("Cambria Math", -1);
......@@ -150,13 +150,13 @@ ParaMath.prototype.Get_CompiledTextPr = function(Copy)
{
// TODO: ParaMath.Get_CompiledTextPr
var TextPr = new CTextPr();
//var TextPr = new CTextPr();
var oContent = this.GetSelectContent();
var mTextPr = oContent.Content.Get_CompiledTextPr(Copy);
TextPr.Merge( mTextPr );
//TextPr.Merge( mTextPr );
return TextPr;
return mTextPr;
};
ParaMath.prototype.Add = function(Item)
......@@ -379,11 +379,23 @@ ParaMath.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll)
else
{
var content = this.GetSelectContent().Content;
var FontSize = TextPr.FontSize;
if(TextPr.FontSize !== undefined && content.IsNormalTextInRuns() == false)
{
var NewTextPr = new CTextPr();
NewTextPr.FontSize = FontSize;
this.Root.Apply_TextPr(NewTextPr, IncFontSize, true);
TextPr.FontSize = undefined;
}
content.Apply_TextPr(TextPr, IncFontSize, ApplyToAll);
}
TextPr.FontSize = FontSize;
}
};
ParaMath.prototype.Clear_TextPr = function()
{
......@@ -522,7 +534,8 @@ ParaMath.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
if(RPI.NeedResize)
{
this.Root.Resize(g_oTextMeasurer, null, this, RPI/*recalculate properties info*/, ArgSize);
this.Root.PreRecalc(null, this, ArgSize, RPI);
this.Root.Resize(g_oTextMeasurer, RPI/*recalculate properties info*/);
// когда формула будеат разбиваться на строки, Position придется перерасчитывать
var pos = new CMathPosition();
pos.x = 0;
......@@ -900,7 +913,11 @@ ParaMath.prototype.SetInline = function(value)
ParaMath.prototype.SetNeedResize = function()
{
this.NeedResize = true;
}
};
ParaMath.prototype.NeedCompiledCtrPr = function()
{
this.Root.NeedCompiledCtrPr();
};
ParaMath.prototype.MathToImageConverter= function()
{
window.IsShapeToImageConverter = true;
......@@ -1497,6 +1514,7 @@ ParaMath.prototype.Split = function (ContentPos, Depth)
if(this.Root.content[Pos].Type == para_Math_Run)
{
NewParaMath = new ParaMath();
NewParaMath.Jc = this.Jc;
var NewRun = this.Root.content[Pos].Split(ContentPos, Depth+1);
NewParaMath.Root.Add_ToContent(0, NewRun);
......
......@@ -7793,7 +7793,7 @@ ParaRun.prototype.Math_Draw = function(x, y, pGraphics)
for(var i=0; i < this.Content.length;i++)
this.Content[i].draw(X, Y, pGraphics);
}
ParaRun.prototype.Math_Recalculate = function(oMeasure, Parent, Paragraph, RPI, ArgSize, WidthPoints)
ParaRun.prototype.Math_Recalculate = function(oMeasure, RPI, WidthPoints)
{
// пересчет элементов контента в Run
// Recalculate_MeasureContent
......@@ -7809,8 +7809,8 @@ ParaRun.prototype.Math_Recalculate = function(oMeasure, Parent, Paragraph, RPI,
var RangeEndPos = this.Content.length;
this.Paragraph = Paragraph;
this.Parent = Parent;
//this.Paragraph = Paragraph;
//this.Parent = Parent;
// обновляем позиции start и end для Range
//this.Lines[0].Add_Range(0, RangeStartPos, RangeEndPos);
......@@ -7857,7 +7857,7 @@ ParaRun.prototype.Math_Recalculate = function(oMeasure, Parent, Paragraph, RPI,
for (var i = 0 ; i < Lng; i++)
{
this.Content[i].Resize(oMeasure, this, RPI);
this.Content[i].Resize(oMeasure, RPI);
var oSize = this.Content[i].size;
......@@ -7951,6 +7951,21 @@ ParaRun.prototype.Math_SetGaps = function(GapsInfo)
}
}
}
ParaRun.prototype.Math_PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
this.Parent = Parent;
this.Paragraph = ParaMath.Paragraph;
var FontSize = this.Get_CompiledPr(false).FontSize;
for (var Pos = 0 ; Pos < this.Content.length; Pos++ )
{
if( !this.Content[Pos].IsAlignPoint() )
GapsInfo.setGaps(this.Content[Pos], FontSize);
this.Content[Pos].PreRecalc(this);
}
}
ParaRun.prototype.IsPlaceholder = function()
{
return this.Content.length == 1 && this.Content[0].IsPlaceholder();
......@@ -8004,6 +8019,10 @@ ParaRun.prototype.Math_GetInfoLetter = function(Info)
else
Info.Result = false;
}
ParaRun.IsNormalText = function()
{
return this.MathPrp.nor === true;
}
function CParaRunStartState(Run)
{
......
......@@ -22,7 +22,7 @@ function CAccentCircumflex()
Asc.extendClass(CAccentCircumflex, CGlyphOperator);
CAccentCircumflex.prototype.calcSize = function(stretch)
{
var alpha = this.Parent.Get_CompiledCtrPrp().FontSize/36;
var alpha = this.Parent.GetTPrpToControlLetter().FontSize/36;
var width = 3.88*alpha;
var height = 3.175*alpha;
......@@ -40,7 +40,7 @@ CAccentCircumflex.prototype.calcSize = function(stretch)
}
CAccentCircumflex.prototype.calcCoord = function(stretch)
{
var fontSize = this.Parent.Get_CompiledCtrPrp().FontSize;
var fontSize = this.Parent.GetTPrpToControlLetter().FontSize;
//var penW = fontSize*g_dKoef_pt_to_mm*this.PEN_W;
//penW *= 96/25.4;
......@@ -126,7 +126,7 @@ function CAccentLine()
Asc.extendClass(CAccentLine, CGlyphOperator);
CAccentLine.prototype.calcSize = function(stretch)
{
var alpha = this.Parent.Get_CompiledCtrPrp().FontSize/36;
var alpha = this.Parent.GetTPrpToControlLetter().FontSize/36;
var height = 1.68*alpha;
var width = 4.938*alpha;
......@@ -135,37 +135,9 @@ CAccentLine.prototype.calcSize = function(stretch)
return {width: width, height: height};
}
CAccentLine.prototype.old_calcCoord = function(stretch)
{
var fontSize = this.Parent.Get_CompiledCtrPrp().FontSize;
var X = [],
Y = [];
//stretch *= 0.9;
X[0] = 0; Y[0] = 0;
X[1] = stretch; Y[1] = 0;
X[2] = stretch; Y[2] = 0.011*fontSize;
X[3] = 0; Y[3] = Y[2];
X[4] = 0; Y[4] = 0;
var W = X[2],
H = Y[2];
return {XX: X, YY: Y, W: W, H: H};
}
CAccentLine.prototype.old_drawPath = function(pGraphics, XX, YY)
{
pGraphics._m(XX[0], YY[0]);
pGraphics._l(XX[1], YY[1]);
pGraphics._l(XX[2], YY[2]);
pGraphics._l(XX[3], YY[3]);
pGraphics._l(XX[4], YY[4]);
}
CAccentLine.prototype.draw = function(x, y, pGraphics)
{
var fontSize = this.Parent.Get_CompiledCtrPrp().FontSize;
var fontSize = this.Parent.GetTPrpToControlLetter().FontSize;
var penW = fontSize*0.067 * 25.4/96;
var x1 = x + 25.4/96,
......@@ -184,7 +156,7 @@ function CAccentDoubleLine()
Asc.extendClass(CAccentDoubleLine, CGlyphOperator);
CAccentDoubleLine.prototype.calcSize = function(stretch)
{
var alpha = this.Parent.Get_CompiledCtrPrp().FontSize/36;
var alpha = this.Parent.GetTPrpToControlLetter().FontSize/36;
var height = 2.843*alpha;
var width = 4.938*alpha;
......@@ -205,7 +177,7 @@ CAccentDoubleLine.prototype.calcSize = function(stretch)
}
CAccentDoubleLine.prototype.old_calcCoord = function(stretch)
{
var fontSize = this.Parent.Get_CompiledCtrPrp().FontSize;
var fontSize = this.Parent.GetTPrpToControlLetter().FontSize;
var X = [],
Y = [];
......@@ -246,7 +218,7 @@ CAccentDoubleLine.prototype.old_drawPath = function(pGraphics, XX, YY)
}
CAccentDoubleLine.prototype.draw = function(x, y, pGraphics)
{
var fontSize = this.Parent.Get_CompiledCtrPrp().FontSize;
var fontSize = this.Parent.GetTPrpToControlLetter().FontSize;
var diff = this.diff;
......@@ -273,7 +245,7 @@ function CAccentTilde()
Asc.extendClass(CAccentTilde, CGlyphOperator);
CAccentTilde.prototype.calcSize = function(stretch)
{
var betta = this.Parent.Get_CompiledCtrPrp().FontSize/36;
var betta = this.Parent.GetTPrpToControlLetter().FontSize/36;
var width = 9.047509765625*betta; // реальная на отрисовке width 7.495282031249999
var height = 2.469444444444444*betta;
......@@ -326,7 +298,7 @@ CAccentTilde.prototype.calcCoord = function(stretch)
var XX = [],
YY = [];
var fontSize = this.Parent.Get_CompiledCtrPrp().FontSize;
var fontSize = this.Parent.GetTPrpToControlLetter().FontSize;
var textScale = fontSize/1000, // 1000 pt
alpha = textScale*25.4/96 /64 ; // g_dKoef_px_to_mm = 25.4/96
......@@ -373,7 +345,7 @@ function CAccentBreve()
Asc.extendClass(CAccentBreve, CGlyphOperator);
CAccentBreve.prototype.calcSize = function(stretch)
{
var betta = this.Parent.Get_CompiledCtrPrp().FontSize/36;
var betta = this.Parent.GetTPrpToControlLetter().FontSize/36;
var width = 4.2333333333333325*betta;
var height = 2.469444444444445*betta;
......@@ -413,7 +385,7 @@ CAccentBreve.prototype.calcCoord = function(stretch)
var XX = [],
YY = [];
var fontSize = this.Parent.Get_CompiledCtrPrp().FontSize;
var fontSize = this.Parent.GetTPrpToControlLetter().FontSize;
var textScale = fontSize/1000, // 1000 pt
alpha = textScale*25.4/96 /64 ; // g_dKoef_px_to_mm = 25.4/96
......@@ -567,13 +539,8 @@ CAccent.prototype.setPosition = function(pos, PosInfo)
this.elements[0][0].setPosition(PosBase, PosInfo);
}
CAccent.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CAccent.prototype.ApplyProperties = function(RPI)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
this.Set_CompiledCtrPrp(ParaMath);
if(this.RecalcInfo.bProps == true)
{
var prp =
......@@ -583,25 +550,26 @@ CAccent.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
loc: LOCATION_TOP
};
var defaultPrp =
{
type: ACCENT_CIRCUMFLEX
};
var defaultPrp = {type: ACCENT_CIRCUMFLEX };
this.operator.mergeProperties(prp, defaultPrp);
this.RecalcInfo.bProps = false;
}
}
CAccent.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
this.ApplyProperties(RPI);
this.operator.PreRecalc(this, ParaMath);
this.operator.relate(this);
var base = this.elements[0][0];
base.Resize(oMeasure, this, ParaMath, RPI, ArgSize);
var ctrPrp = this.Get_CompiledCtrPrp();
oMeasure.SetFont(ctrPrp);
CAccent.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSize, RPI, GapsInfo);
}
CAccent.prototype.Resize = function(oMeasure, RPI)
{
var base = this.getBase();
base.Resize(oMeasure, RPI);
this.operator.fixSize(ParaMath, oMeasure, base.size.width);
this.operator.fixSize(oMeasure, base.size.width);
var width = base.size.width, // (!)
height = base.size.height + this.operator.size.height,
......
......@@ -13,6 +13,7 @@ function CMathBase(bInside)
this.CtrPrp = new CTextPr();
this.CompiledCtrPrp = new CTextPr();
this.TextPrControlLetter = new CTextPr();
this.ArgSize = new CMathArgSize();
......@@ -97,7 +98,6 @@ CMathBase.prototype =
if(txtPrp !== null && typeof(txtPrp) !== "undefined")
{
this.CtrPrp.Merge(txtPrp);
this.CtrPrp.FontFamily = {Name : "Cambria Math", Index : -1 };
}
},
Get_CtrPrp: function()
......@@ -110,6 +110,16 @@ CMathBase.prototype =
return CtrPrp;
},
NeedCompiledCtrPr: function()
{
this.RecalcInfo.bCtrPrp = true;
for(var i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++)
if(!this.elements[i][j].IsJustDraw())
this.elements[i][j].NeedCompiledCtrPr();
},
/*Set_CompiledCtrPrp: function(ParaMath)
{
var defaultRPrp = ParaMath.GetFirstRPrp();
......@@ -125,7 +135,7 @@ CMathBase.prototype =
},*/
Get_CompiledCtrPrp: function()
{
this.Set_CompiledCtrPrp(this.ParaMath);
this.Set_CompiledCtrPrp(this.Parent, this.ParaMath);
var CompiledCtrPrp;
......@@ -145,7 +155,7 @@ CMathBase.prototype =
},
Get_CompiledCtrPrp_2: function() // without arg Size
{
this.Set_CompiledCtrPrp(this.ParaMath);
this.Set_CompiledCtrPrp(this.Parent, this.ParaMath);
var CompiledCtrPrp;
......@@ -172,12 +182,11 @@ CMathBase.prototype =
},
// для управляющих символов в приоритете GetFirstRunPrp
// если первый элемент - мат объект, то берутся его CtrPrp
getPrpToControlLetter: function()
GetTPrpToControlLetter: function()
{
var rPrp = new CTextPr();
rPrp.Merge( this.ParaMath.GetFirstRPrp() );
this.Set_CompiledCtrPrp(this.Parent, this.ParaMath);
return rPrp;
return this.TextPrControlLetter;
},
fillPlaceholders: function()
{
......@@ -344,6 +353,26 @@ CMathBase.prototype =
{
return this.Parent.remove(order);
},
ApplyProperties: function(RPI)
{},
PreRecalc: function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
this.Set_CompiledCtrPrp(Parent, ParaMath);
this.ApplyProperties(RPI);
// setGaps обязательно после того как смержили CtrPrp (Set_CompiledCtrPrp)
if(this.bInside == false)
GapsInfo.setGaps(this, this.TextPrControlLetter.FontSize);
for(var i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++)
this.elements[i][j].PreRecalc(this, ParaMath, ArgSize, RPI);
},
recalculateSize: function(oMeasure, RPI)
{
var width = 0;
......@@ -366,20 +395,16 @@ CMathBase.prototype =
width += this.dW*(this.nCol - 1) + this.GapLeft + this.GapRight;
var ascent = this.getAscent(oMeasure, height, RPI);
var ascent = this.getAscent(oMeasure, height);
this.size = {width: width, height: height, ascent: ascent};
},
Resize: function(oMeasure, Parent, ParaMath, RPI, ArgSize)
Resize: function(oMeasure, RPI)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
//this.Set_CompiledCtrPrp(ParaMath);
for(var i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++)
this.elements[i][j].Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.elements[i][j].Resize(oMeasure, RPI);
this.recalculateSize(oMeasure, RPI);
},
......@@ -390,7 +415,58 @@ CMathBase.prototype =
if(!this.elements[i][j].IsJustDraw())
this.elements[i][j].Resize_2(oMeasure, this, ParaMath, RPI, ArgSize);
},
Set_CompiledCtrPrp: function(ParaMath)
Set_CompiledCtrPrp: function(Parent, ParaMath)
{
if(this.RecalcInfo.bCtrPrp == true)
{
// for Ctr Prp
//this.CompiledCtrPrp = ParaMath.GetFirstRPrp();
var defaultTxtPrp = ParaMath.Get_Default_TPrp();
this.CompiledCtrPrp.FontFamily =
{
Name: defaultTxtPrp.FontFamily.Name,
Index: defaultTxtPrp.FontFamily.Index
};
this.CompiledCtrPrp.FontSize = defaultTxtPrp.FontSize;
this.CompiledCtrPrp.Merge(this.CtrPrp);
// for Control Letter
var FontSize = ParaMath.GetFirstRPrp().FontSize;
if(this.bInside == true)
{
var TxtPr = Parent.Get_TxtPrControlLetter();
FontSize = TxtPr.FontSize;
FontSize = ParaMath.ApplyArgSize(FontSize, this.ArgSize.value);
}
else
{
FontSize = ParaMath.ApplyArgSize(FontSize, Parent.Get_CompiledArgSize().value);
FontSize = ParaMath.ApplyArgSize(FontSize, this.ArgSize.value);
}
this.TextPrControlLetter.FontSize = FontSize;
this.TextPrControlLetter.FontFamily =
{
Name: defaultTxtPrp.FontFamily.Name,
Index: defaultTxtPrp.FontFamily.Index
};
this.RecalcInfo.bCtrPrp = false;
}
},
Get_TxtPrControlLetter: function() // TextPrControlLetter не копируются !
{
this.Set_CompiledCtrPrp(this.Parent, this.ParaMath);
return this.TextPrControlLetter;
},
old_Set_CompiledCtrPrp: function(ParaMath)
{
if(this.RecalcInfo.bCtrPrp == true)
{
......@@ -488,8 +564,8 @@ CMathBase.prototype =
},
SetGaps: function(GapsInfo)
{
this.Parent = GapsInfo.Parent;
this.ParaMath = GapsInfo.ParaMath;
//this.Parent = GapsInfo.Parent;
//this.ParaMath = GapsInfo.ParaMath;
GapsInfo.Left = GapsInfo.Current;
......@@ -566,6 +642,9 @@ CMathBase.prototype =
},
Apply_TextPr: function(TextPr, IncFontSize, ApplyToAll)
{
if(ApplyToAll == true)
this.RecalcInfo.bCtrPrp = true;
if(TextPr == undefined)
{
var CtrPrp = this.Get_CompiledCtrPrp_2();
......
"use strict";
function CMathBreak()
{
this.AlnAt = undefined;
}
CMathBreak.prototype.Set_FromObj = function(Obj)
{
if(Obj.AlnAt !== undefined && Obj.AlnAt !== null && Obj.AlnAt - 0 == 0)
{
if(Obj.AlnAt >= 0 && Obj.AlnAt <= 255)
this.AlnAt = Obj.AlnAt;
}
}
function CMathBorderBoxPr()
{
this.hideBot = false;
......@@ -139,7 +152,7 @@ CBorderBox.prototype.recalculateSize = function()
var height = base.height;
var ascent = base.ascent;
this.gapBrd = this.Get_CompiledCtrPrp().FontSize*0.08104587131076388;
this.gapBrd = this.GetTPrpToControlLetter().FontSize*0.08104587131076388;
if(this.Pr.hideTop == false)
{
......@@ -162,7 +175,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
{
this.elements[0][0].draw(x, y, pGraphics);
var penW = this.Get_CompiledCtrPrp().FontSize*0.02;
var penW = this.GetTPrpToControlLetter().FontSize*0.02;
var Width = this.size.width - this.GapLeft - this.GapRight,
Height = this.size.height;
......@@ -523,28 +536,24 @@ CBar.prototype.fillContent = function()
this.setDimension(1, 1);
this.elements[0][0] = this.getBase();
}
CBar.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CBar.prototype.ApplyProperties = function(RPI)
{
if(this.RecalcInfo.bProps == true)
{
var prp =
{
loc: this.Pr.pos,
type: DELIMITER_LINE
};
var prp = {loc: this.Pr.pos, type: DELIMITER_LINE };
var defaultProps =
{
loc: LOCATION_BOT
};
var defaultProps = { loc: LOCATION_BOT};
this.setCharacter(prp, defaultProps);
this.RecalcInfo.bProps = false;
}
}
CBar.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
this.ApplyProperties(RPI);
this.operator.PreRecalc(this, ParaMath);
//this.Set_CompiledCtrPrp(ParaMath);
CBar.superclass.Resize.call(this, oMeasure, Parent, ParaMath, RPI, ArgSize);
CBar.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSize, RPI, GapsInfo);
}
CBar.prototype.getAscent = function()
{
......
......@@ -46,6 +46,7 @@ function CDegreeBase(props, bInside)
if(props !== null && typeof(props) !== "undefined")
this.init(props);
//CDegreeBase.prototype.init.call(this, props);
}
Asc.extendClass(CDegreeBase, CMathBase);
CDegreeBase.prototype.init = function(props)
......@@ -59,19 +60,41 @@ CDegreeBase.prototype.fillContent = function()
this.elements[0][0] = this.baseContent;
this.elements[0][1] = this.iterContent;
};
CDegreeBase.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CDegreeBase.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
//this.Set_CompiledCtrPrp(ParaMath);
this.Set_CompiledCtrPrp(Parent, ParaMath);
this.ApplyProperties(RPI);
if(this.bInside == false)
GapsInfo.setGaps(this, this.TextPrControlLetter.FontSize);
this.elements[0][0].Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.baseContent.PreRecalc(this, ParaMath, ArgSize, RPI);
var ArgSzDegr = ArgSize.Copy();
ArgSzDegr.decrease();
this.elements[0][1].Resize(oMeasure, this, ParaMath, RPI, ArgSzDegr);
var RPIDegr = RPI.Copy();
RPIDegr.bDecreasedComp = true;
this.iterContent.PreRecalc(this, ParaMath, ArgSzDegr, RPIDegr);
}
CDegreeBase.prototype.Resize = function(oMeasure, RPI)
{
//this.Parent = Parent;
//this.ParaMath = ParaMath;
//this.Set_CompiledCtrPrp(ParaMath);
this.baseContent.Resize(oMeasure, RPI);
//var ArgSzDegr = ArgSize.Copy();
//ArgSzDegr.decrease();
this.iterContent.Resize(oMeasure, RPI);
if(this.Pr.type === DEGREE_SUPERSCRIPT)
this.recalculateSup(oMeasure);
......@@ -83,24 +106,20 @@ CDegreeBase.prototype.recalculateSup = function(oMeasure)
var base = this.elements[0][0].size,
iter = this.elements[0][1].size;
var mgCtrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.GetTPrpToControlLetter();
var shCenter = this.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp);
this.upBase = 0;
this.upIter = 0;
var oBase = this.elements[0][0];
//var bBaseOnlyText = oBase.IsJustDraw() ? false : oBase.IsOnlyText(); // у Just-Draw элементов нет ф-ии IsOnlyText
var bOneLineText = oBase.IsJustDraw() ? false : oBase.IsOneLineText();
if(bOneLineText)
{
//var UpBaseline = 1.786*shCenter; // baseline итератора
var UpBaseline = 1.65*shCenter; // baseline итератора
// iter.height - UpBaseline - iter.ascent + base.ascent > 2/3 * base.height
if(iter.height - UpBaseline - iter.ascent + base.ascent > 2/3 * base.ascent)
this.upBase = iter.height - 2/3*base.ascent;
else if(UpBaseline + iter.ascent > base.ascent)
......@@ -138,15 +157,13 @@ CDegreeBase.prototype.recalculateSubScript = function(oMeasure)
var base = this.elements[0][0].size,
iter = this.elements[0][1].size;
var mgCtrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.GetTPrpToControlLetter();
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 bBaseOnlyText = oBase.IsJustDraw() ? false : oBase.IsOnlyText(); // у Just-Draw элементов нет ф-ии IsOnlyText
var bOneLineText = oBase.IsJustDraw() ? false : oBase.IsOneLineText();
if(bOneLineText)
......@@ -278,6 +295,24 @@ CIterators.prototype.init = function()
this.elements[0][0] = this.iterUp;
this.elements[1][0] = this.iterDn;
};
CIterators.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
this.ArgSize.SetValue(-1);
var ArgSzIters = ArgSize.Copy();
ArgSzIters.Merge(this.ArgSize);
this.Set_CompiledCtrPrp(Parent, ParaMath);
var RPI_ITER = RPI.Copy();
RPI_ITER.bDecreasedComp = true;
this.iterUp.PreRecalc(this, ParaMath, ArgSzIters, RPI_ITER);
this.iterDn.PreRecalc(this, ParaMath, ArgSzIters, RPI_ITER);
};
CIterators.prototype.getUpperIterator = function()
{
return this.elements[0][0];
......@@ -294,10 +329,6 @@ CIterators.prototype.setLowerIterator = function(iterator)
{
this.elements[1][0] = iterator;
};
CIterators.prototype.Get_CompiledCtrPrp = function()
{
return this.Parent.Get_CompiledCtrPrp();
};
CIterators.prototype.alignIterators = function(mcJc)
{
this.alignment.wdt[0] = mcJc;
......@@ -354,6 +385,7 @@ function CDegreeSubSupBase(props, bInside)
CDegreeSubSupBase.superclass.constructor.call(this, bInside);
this.gapBase = 0;
this.bNaryInline = false;
this.Pr = new CMathDegreeSubSupPr();
......@@ -392,7 +424,29 @@ CDegreeSubSupBase.prototype.fillContent = function()
oIters.alignIterators(MCJC_RIGHT);
}
};
CDegreeSubSupBase.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CDegreeSubSupBase.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
this.bNaryInline = RPI.bNaryInline;
CDegreeSubSupBase.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSize, RPI, GapsInfo);
};
/*CDegreeSubSupBase.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
this.Set_CompiledCtrPrp(Parent, ParaMath);
var ArgSzIters = ArgSize.Copy();
ArgSzIters.decrease();
if(this.bInside == false)
GapsInfo.setGaps(this, this.TextPrControlLetter.FontSize);
this.baseContent.PreRecalc(this, ParaMath, ArgSize, RPI);
this.iters.PreRecalc(this, ParaMath, ArgSzIters, RPI);
};*/
/*CDegreeSubSupBase.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
......@@ -406,10 +460,14 @@ CDegreeSubSupBase.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, A
this.iters.Resize(oMeasure, this, ParaMath, RPI, ArgSzIters);
this.recalculateSize(oMeasure, RPI);
};
};*/
CDegreeSubSupBase.prototype.recalculateSize = function(oMeasure, RPI)
{
var mgCtrPrp = this.Get_CompiledCtrPrp();
//var mgCtrPrp = this.GetTPrpToControlLetter();
var mgCtrPrp = this.Get_CompiledCtrPrp(); // Get_CompiledCtrPrp - чтобы итераторы не разъезжались
// половину ascent брать нельзя, т.к. черта дроби будет разделительной для верхнего и нижнего итератора => соответственно
// если числитель меньше/больше знаменателя расположение итераторов у степени будет неправильным
var shCenter = this.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp);
shCenter *= 1.4;
......@@ -433,16 +491,17 @@ CDegreeSubSupBase.prototype.recalculateSize = function(oMeasure, RPI)
iterDown = iters.elements[1][0].size;
var lUp = base.size.ascent - shCenter; // center of base
//var lUp = base.size.height/2; // center of base
var lDown = base.size.height - lUp; // height - center of base
var ctrPrpIter = iters.Get_CompiledCtrPrp();
var ctrPrpIter = iters.GetTPrpToControlLetter();
var shIter = this.ParaMath.GetShiftCenter(oMeasure, ctrPrpIter); //смещение
var minGap = 0.7*shIter;
var up, down;
if(RPI.bNaryInline == true)
if(this.bNaryInline)
{
up = down = 0;
}
......@@ -467,7 +526,6 @@ CDegreeSubSupBase.prototype.recalculateSize = function(oMeasure, RPI)
}
if(up + down > minGap)
{
this.gapBase = iterUp.height + up - lUp;
......
......@@ -75,9 +75,7 @@ CFraction.prototype.draw = function(x, y, pGraphics)
}
CFraction.prototype.drawBarFraction = function(x, y, pGraphics)
{
//var mgCtrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.Get_CompiledCtrPrp_2();
mgCtrPrp.FontSize = this.ParaMath.ApplyArgSize(mgCtrPrp.FontSize, this.Parent.Get_CompiledArgSize().value);
var mgCtrPrp = this.GetTPrpToControlLetter();
var penW = mgCtrPrp.FontSize* 25.4/96 * 0.08;
......@@ -102,8 +100,7 @@ CFraction.prototype.drawBarFraction = function(x, y, pGraphics)
}
CFraction.prototype.drawSkewedFraction = function(x, y, pGraphics)
{
//var ctrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.GetTPrpToControlLetter();
var penW = mgCtrPrp.FontSize/12.5*g_dKoef_pix_to_mm;
......@@ -208,8 +205,7 @@ CFraction.prototype.drawLinearFraction = function(x, y, pGraphics)
x2 = X + this.elements[0][0].size.width + shift,
y2 = Y + this.size.height;
//var ctrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.GetTPrpToControlLetter();
var penW = mgCtrPrp.FontSize/12.5*g_dKoef_pix_to_mm;
pGraphics.SetFont(mgCtrPrp);
......@@ -247,7 +243,45 @@ CFraction.prototype.getDenominator = function()
return denominator;
}
CFraction.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CFraction.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
var ArgSzNumDen = ArgSize.Copy();
if(RPI.bInline == true && (this.Pr.type === BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION)) // уменьшае размер числителя и знаменателя
{
ArgSzNumDen.decrease(); // для контентов числителя и знаменателя
this.ArgSize.SetValue(-1); // для CtrPrp
}
else if(RPI.bDecreasedComp == true) // уменьшаем расстояние между числителем и знаменателем (размер FontSize для TxtPr ControlLetter)
// this.ArgSize отвечает за TxtPr ControlLetter
{
this.ArgSize.SetValue(-1); // для CtrPrp
}
else
{
this.ArgSize.SetValue(0);
}
this.Set_CompiledCtrPrp(Parent, ParaMath);
this.ApplyProperties(RPI);
var NewRPI = RPI.Copy();
if(this.Pr.type !== LINEAR_FRACTION)
NewRPI.bDecreasedComp = true;
// setGaps обязательно после того как смержили CtrPrp (Set_CompiledCtrPrp)
if(this.bInside == false)
GapsInfo.setGaps(this, this.TextPrControlLetter.FontSize);
this.Numerator.PreRecalc(this, ParaMath, ArgSzNumDen, NewRPI);
this.Denominator.PreRecalc(this, ParaMath, ArgSzNumDen, NewRPI);
}
/*CFraction.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
var ArgSzFr = ArgSize.Copy();
......@@ -265,6 +299,8 @@ CFraction.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
this.ArgSize.SetValue(0);
}
// ??!!
if(this.Pr.type == NO_BAR_FRACTION)
{
ArgSzFr.decrease();
......@@ -279,10 +315,11 @@ CFraction.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
//this.Set_CompiledCtrPrp(ParaMath);
var NewRPI = RPI.Copy();
NewRPI.bInsideFraction = true;
if(this.Pr.type !== LINEAR_FRACTION)
NewRPI.bInsideFraction = true;
CFraction.superclass.Resize.call(this, oMeasure, Parent, ParaMath, NewRPI, ArgSzFr);
}
}*/
CFraction.prototype.recalculateSize = function(oMeasure)
{
if(this.Pr.type == BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION)
......@@ -297,8 +334,7 @@ CFraction.prototype.recalculateBarFraction = function(oMeasure)
var num = this.elements[0][0].size,
den = this.elements[1][0].size;
//var ctrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.GetTPrpToControlLetter();
var width = num.width > den.width ? num.width : den.width;
var height = num.height + den.height;
......@@ -310,8 +346,7 @@ CFraction.prototype.recalculateBarFraction = function(oMeasure)
}
CFraction.prototype.recalculateSkewed = function(oMeasure)
{
//var ctrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.GetTPrpToControlLetter();
//this.gapSlash = 5.011235894097222 * mgCtrPrp.FontSize/36;
this.dW = 5.011235894097222 * mgCtrPrp.FontSize/36;
......@@ -331,8 +366,8 @@ CFraction.prototype.recalculateLinear = function()
DescentSecond = this.elements[0][1].size.height - this.elements[0][1].size.ascent;
var H = AscentFirst + DescentSecond;
//var ctrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.GetTPrpToControlLetter();
var gap = 5.011235894097222*mgCtrPrp.FontSize/36;
......@@ -428,7 +463,7 @@ CFractionBase.prototype.init = function(MathContent)
this.setDimension(1, 1);
this.elements[0][0] = MathContent;
}
CFractionBase.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
/*CFractionBase.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
......@@ -438,7 +473,7 @@ CFractionBase.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSi
this.elements[0][0].Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.recalculateSize();
}
}*/
CFractionBase.prototype.getElement = function()
{
return this.elements[0][0];
......@@ -465,7 +500,7 @@ CNumerator.prototype.recalculateSize = function()
{
var arg = this.elements[0][0].size;
var mgCtrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.GetTPrpToControlLetter();
var Descent = arg.height - arg.ascent; // baseLine
......@@ -517,7 +552,7 @@ CDenominator.prototype.recalculateSize = function()
{
var arg = this.elements[0][0].size;
var mgCtrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.GetTPrpToControlLetter();
var Ascent = arg.ascent - 4.938888888888888*mgCtrPrp.FontSize/36;
......
......@@ -30,6 +30,87 @@ CMathLimitPr.prototype.Read_FromBinary = function(Reader)
this.type = Reader.GetLong();
};
function CLimitPrimary(bInside, Type, FName, Iterator)
{
CLimitPrimary.superclass.constructor.call(this, bInside);
this.Type = Type;
this.FName = null;
this.Iterator = null;
this.init(FName, Iterator);
}
Asc.extendClass(CLimitPrimary, CMathBase);
CLimitPrimary.prototype.init = function(FName, Iterator)
{
this.setDimension(2, 1);
if(this.Type == LIMIT_LOW)
{
this.FName = FName;
this.Iterator = new CDenominator(Iterator);
this.elements[0][0] = this.FName;
this.elements[1][0] = this.Iterator;
}
else
{
this.Iterator = Iterator;
this.FName = FName;
this.elements[0][0] = this.Iterator;
this.elements[1][0] = this.FName;
}
}
CLimitPrimary.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
this.Set_CompiledCtrPrp(Parent, ParaMath);
if(this.bInside == false)
GapsInfo.setGaps(this, this.TextPrControlLetter.FontSize);
this.FName.PreRecalc(this, ParaMath, ArgSize, RPI);
var ArgSzIter = ArgSize.Copy();
ArgSzIter.decrease();
var NewRPI = RPI.Copy();
NewRPI.bDecreasedComp = true;
this.Iterator.PreRecalc(this, ParaMath, ArgSzIter, NewRPI);
}
CLimitPrimary.prototype.Resize = function(oMeasure, RPI)
{
if(this.Type == LIMIT_LOW)
this.dH = 0;
else
this.dH = 0.06*this.GetTPrpToControlLetter().FontSize;
this.FName.Resize(oMeasure, RPI);
this.Iterator.Resize(oMeasure, RPI);
var SizeFName = this.FName.size,
SizeIter = this.Iterator.size;
var width = SizeFName.width > SizeIter.width ? SizeFName.width : SizeIter.width,
height = SizeFName.height + SizeIter.height,
ascent;
if(this.Type == LIMIT_LOW)
ascent = SizeFName.ascent;
else if(this.Type == LIMIT_UP)
ascent = SizeIter.height + this.dH + SizeFName.ascent;
width += this.GapLeft + this.GapRight;
this.size = {width: width, height: height, ascent: ascent};
}
function CLimit(props)
{
CLimit.superclass.constructor.call(this);
......@@ -67,121 +148,35 @@ CLimit.prototype.getIterator = function()
{
return this.Content[1];
}
CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CLimit.prototype.ApplyProperties = function(RPI)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
if(this.RecalcInfo.bProps == true || RPI.bChangeInline == true)
{
this.setDimension(1, 1);
if(RPI.bInline == true && RPI.bMathFunc == true)
{
this.setDimension(1, 1);
var props;
if(this.Pr.type == LIMIT_LOW)
{
props =
{
type: DEGREE_SUBSCRIPT,
ctrPrp: this.CtrPrp
};
}
props = {type: DEGREE_SUBSCRIPT, ctrPrp: this.CtrPrp};
else
{
props =
{
type: DEGREE_SUPERSCRIPT,
ctrPrp: this.CtrPrp
};
}
this.elements[0][0] = new CDegreeBase(null, true);
props = {type: DEGREE_SUPERSCRIPT, ctrPrp: this.CtrPrp};
this.elements[0][0] = new CDegreeBase(props, true);
this.elements[0][0].setBase(this.getFName());
this.elements[0][0].setIterator(this.getIterator());
this.elements[0][0].fillContent();
this.FName = this.getFName();
this.Iterator = this.getIterator();
}
else
{
this.setDimension(2, 1);
if(this.Pr.type == LIMIT_LOW)
{
this.dH = 0;
this.FName = this.getFName();
this.Iterator = new CDenominator(this.getIterator());
this.elements[0][0] = this.FName;
this.elements[1][0] = this.Iterator;
}
else
{
this.FName = this.getFName();
this.Iterator = this.getIterator();
this.dH = 0.06*this.Get_CompiledCtrPrp().FontSize;
this.elements[0][0] = this.Iterator;
this.elements[1][0] = this.FName;
}
this.elements[0][0] = new CLimitPrimary(true, this.Pr.type, this.getFName(), this.getIterator());
}
this.RecalcInfo.bProps = false;
}
if(RPI.bInline == true && RPI.bMathFunc == true)
{
this.elements[0][0].Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.size =
{
width: this.elements[0][0].size.width,
height: this.elements[0][0].size.height,
ascent: this.elements[0][0].size.ascent
};
}
else
{
this.FName.Resize(oMeasure, this, ParaMath, RPI, ArgSize);
var ArgSzIter = ArgSize.Copy();
ArgSzIter.decrease();
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,
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;
this.size = {width: width, height: height, ascent: ascent};
}
}
function CMathFunc(props)
{
CMathFunc.superclass.constructor.call(this);
......@@ -207,18 +202,16 @@ CMathFunc.prototype.init = function(props)
this.setProperties(props);
this.fillContent();
}
CMathFunc.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CMathFunc.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
RPI.bMathFunc = true;
CMathFunc.superclass.Resize.call(this, oMeasure, Parent, ParaMath, RPI, ArgSize);
RPI.bMathFunc = false;
var NewRPI = RPI.Copy();
NewRPI.bMathFunc = true;
CMathFunc.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSize, NewRPI, GapsInfo);
}
CMathFunc.prototype.setDistance = function()
{
this.dW = this.Get_CompiledCtrPrp().FontSize/6*g_dKoef_pt_to_mm;
this.dW = this.GetTPrpToControlLetter().FontSize/6*g_dKoef_pt_to_mm;
}
CMathFunc.prototype.getFName = function()
{
......
......@@ -32,9 +32,8 @@
function CRPI()
{
//this.UpdateMathPr = true;
this.NeedResize = true;
this.bInsideFraction = false;
this.bDecreasedComp = false;
this.bInline = false;
this.bChangeInline = false;
this.bNaryInline = false; /*для CDegreeSupSub внутри N-арного оператора, этот флаг необходим, чтобы итераторы максимально близко друг к другу расположить*/
......@@ -46,8 +45,9 @@ CRPI.prototype.Copy = function()
{
var RPI = new CRPI();
RPI.NeedResize = this.NeedResize;
RPI.bInline = this.bInline;
RPI.bInsideFraction = this.bInsideFraction;
RPI.bDecreasedComp = this.bDecreasedComp;
RPI.bChangeInline = this.bChangeInline;
RPI.bNaryInline = this.bNaryInline;
RPI.bEqqArray = this.bEqqArray;
......@@ -324,17 +324,23 @@ var COEFF_GAPS = new CCoeffGaps();
function CMathArgSize()
{
this.value = 0;
this.value = undefined;
}
CMathArgSize.prototype =
{
decrease: function()
{
if(this.value == undefined)
this.value = 0;
if( this.value > -2 )
this.value--;
},
increase: function()
{
if(this.value == undefined)
this.value = 0;
if(this.value < 2)
this.value++;
},
......@@ -361,29 +367,44 @@ CMathArgSize.prototype =
},
Merge: function(ArgSize)
{
if(this.value == undefined)
this.value = 0;
if(ArgSize.value == undefined)
ArgSize.value = 0;
this.SetValue(this.value + ArgSize.value);
}
}
function CMathGapsInfo(oMeasure, Parent, argSize)
function CMathGapsInfo(argSize)
{
this.measure = oMeasure;
//this.measure = oMeasure;
this.Parent = Parent;
this.ParaMath = this.Parent.ParaMath; // для Para_Run
//this.Parent = Parent;
//this.ParaMath = this.Parent.ParaMath; // для Para_Run
this.argSize = argSize; // argSize выставляем один раз для всего контента
this.leftRunPrp = null; // Run_Prp левого элемента
this.currRunPrp = null;
//this.leftRunPrp = null; // Run_Prp левого элемента
//this.currRunPrp = null;
this.Left = null; // элемент слева
this.Left = null; // элемент слева
this.Current = null; // текущий элемент
this.LeftFontSize = null;
this.CurrentFontSize = null;
}
CMathGapsInfo.prototype =
{
setGaps: function()
setGaps: function(Current, CurrentFontSize)
{
this.Left = this.Current;
this.LeftFontSize = this.CurrentFontSize;
this.Current = Current;
this.CurrentFontSize = CurrentFontSize;
if(this.argSize < 0)
{
this.Current.GapLeft = 0;
......@@ -458,12 +479,12 @@ CMathGapsInfo.prototype =
leftCoeff = Math.ceil(leftCoeff*10)/10;
rightCoeff = Math.ceil(rightCoeff*10)/10;
var LGapSign = 0.1513*this.currRunPrp.FontSize;
var LGapSign = 0.1513*this.CurrentFontSize;
this.Current.GapLeft = Math.ceil(leftCoeff*LGapSign*10)/10; // если ни один случай не выполнился, выставляем "нулевые" gaps (default): необходимо, если что-то удалили и объект стал первый или последним в контенте
if(this.Left != null)
{
var RGapSign = 0.1513*this.leftRunPrp.FontSize;
var RGapSign = 0.1513*this.LeftFontSize;
this.Left.GapRight = Math.ceil(rightCoeff*RGapSign*10)/10;
}
}
......@@ -752,7 +773,7 @@ CMathContent.prototype =
this.size = {width: width, height: ascent + descent, ascent: ascent};
},*/
Resize: function(oMeasure, Parent, ParaMath, RPI, ArgSize) // пересчитываем всю формулу
old_Resize: function(oMeasure, Parent, ParaMath, ArgSize, RPI) // пересчитываем всю формулу
{
if(ArgSize !== null && ArgSize !== undefined)
{
......@@ -826,19 +847,7 @@ CMathContent.prototype =
this.size.height = SizeDescent < oDescent ? oDescent + this.size.ascent : SizeDescent + this.size.ascent;
}
},
Resize_2: function(oMeasure, Parent, ParaMath, RPI, ArgSize) // особый случай: вызываем, когда пересчет всей формулы не нужен, а нужно выставить только Lines (Реализована, чтобы не править Resize у каждого элемента)
{
var lng = this.content.length;
for(var i = 0; i < lng; i++)
{
if(this.content[i].Type == para_Math_Composition)
this.content[i].Resize_2(oMeasure, this, ParaMath, RPI, ArgSize);
else
this.content[i].Math_Recalculate(oMeasure, this, ParaMath.Paragraph, RPI, ArgSize, null);
}
},
M_Resize: function(oMeasure, Parent, ParaMath, RPI, ArgSize) // если делать один цикл for для Resize, то надо избавиться от WidthToElement,
// т.к. корректно рассчитывать не получается, либо выставлять WidthToElement для пустыx Run (которые идут после мат объекта) на recalculateSize_2 мат объекта
PreRecalc: function(Parent, ParaMath, ArgSize, RPI)
{
if(ArgSize !== null && ArgSize !== undefined)
{
......@@ -853,83 +862,82 @@ CMathContent.prototype =
this.Parent = Parent;
}
this.WidthToElement.length = 0;
if(ArgSize !== null && ArgSize !== undefined)
{
this.Compiled_ArgSz.value = this.ArgSize.value;
this.Compiled_ArgSz.Merge(ArgSize);
}
var GapsInfo = new CMathGapsInfo(oMeasure, this, this.Compiled_ArgSz.value);
var lng = this.content.length;
if (!this.bRoot && this.content.length == 0)
this.fillPlaceholders();
var GapsInfo = new CMathGapsInfo(this.Compiled_ArgSz.value);
for(var pos = 0; pos < lng; pos++)
{
if(this.content[pos].Type == para_Math_Composition)
{
this.content[pos].PreRecalc(this, ParaMath, this.Compiled_ArgSz, RPI, GapsInfo);
}
else if(this.content[pos].Type == para_Math_Run)
this.content[pos].Math_PreRecalc(this, ParaMath, this.Compiled_ArgSz, RPI, GapsInfo);
}
if(GapsInfo.Current !== null)
GapsInfo.Current.GapRight = 0;
},
Resize: function(oMeasure, RPI) // пересчитываем всю формулу
{
this.WidthToElement.length = 0;
this.RecalcInfo.bEqqArray = RPI.bEqqArray;
var lng = this.content.length;
this.size.SetZero();
this.InfoPoints.SetDefault();
var PosUpdate = -1;
var bEmptyRun;
for(var pos = 0; pos < lng; pos++)
{
bEmptyRun = this.content[pos].Type == para_Math_Run && this.content[pos].Is_Empty();
if(this.content[pos].Type == para_Math_Composition)
{
this.content[pos].SetGaps(GapsInfo);
var NewRPI = RPI.Copy();
NewRPI.bEqqArray = false;
this.content[pos].Resize(oMeasure, NewRPI);
if(RPI.bEqqArray)
this.InfoPoints.ContentPoints.UpdatePoint(this.content[pos].size.width);
}
else if(this.content[pos].Type == para_Math_Run)
this.content[pos].Math_SetGaps(GapsInfo);
{
//this.content[pos].Recalculate_Range();
this.content[pos].Math_Recalculate(oMeasure, RPI, this.InfoPoints.ContentPoints);
}
// если пропускаем расчет одного из элементов, то WidthToElement будет неправильно выставлен
// если выставлять WidthToElement на recalculateSize_2, то WidthToElement не будет выставлен для пустых Run
this.WidthToElement[pos] = this.size.width;
// для случая если между двумя мат объектами стоит пустой Run, то Gaps должны рассчитываться между двумя этими мат объектами
// и при расчете должны сначала выставиться у правого мат объекта Gaps, а потом рассчитываться размер левого объекта
if(!bEmptyRun)
{
if(PosUpdate >= 0)
this.recalculateSize_2(PosUpdate, oMeasure, Parent, ParaMath, RPI);
PosUpdate = pos;
}
}
var oSize = this.content[pos].size;
this.size.width += oSize.width;
if(GapsInfo.Current !== null)
GapsInfo.Current.GapRight = 0;
var oDescent = oSize.height - oSize.ascent,
SizeDescent = this.size.height - this.size.ascent;
if(PosUpdate != -1)
this.recalculateSize_2(PosUpdate, oMeasure, Parent, ParaMath, RPI);
this.size.ascent = this.size.ascent > oSize.ascent ? this.size.ascent : oSize.ascent;
this.size.height = SizeDescent < oDescent ? oDescent + this.size.ascent : SizeDescent + this.size.ascent;
}
},
recalculateSize_2: function(pos, oMeasure, Parent, ParaMath, RPI)
// особый случай: вызываем, когда пересчет всей формулы не нужен, а нужно выставить только Lines (Реализована, чтобы не править Resize у каждого элемента)
Resize_2: function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
if(this.content[pos].Type == para_Math_Composition)
var lng = this.content.length;
for(var i = 0; i < lng; i++)
{
var NewRPI = RPI.Copy();
NewRPI.bEqqArray = false;
this.content[pos].Resize(oMeasure, this, ParaMath, NewRPI, this.Compiled_ArgSz);
if(RPI.bEqqArray)
this.InfoPoints.ContentPoints.UpdatePoint(this.content[pos].size.width);
if(this.content[i].Type == para_Math_Composition)
this.content[i].Resize_2(oMeasure, this, ParaMath, RPI, ArgSize);
else
this.content[i].Math_Recalculate(oMeasure, this, ParaMath.Paragraph, RPI, ArgSize, null);
}
else if(this.content[pos].Type == para_Math_Run)
this.content[pos].Math_Recalculate(oMeasure, this, ParaMath.Paragraph, RPI, this.Compiled_ArgSz, this.InfoPoints.ContentPoints);
var oSize = this.content[pos].size;
this.size.width += oSize.width;
var oDescent = oSize.height - oSize.ascent,
SizeDescent = this.size.height - this.size.ascent;
this.size.ascent = this.size.ascent > oSize.ascent ? this.size.ascent : oSize.ascent;
this.size.height = SizeDescent < oDescent ? oDescent + this.size.ascent : SizeDescent + this.size.ascent;
},
getWidthsPoints: function()
{
......@@ -1140,6 +1148,10 @@ CMathContent.prototype =
{
this.ArgSize.SetValue(val);
},
GetArgSize: function()
{
return this.ArgSize.value;
},
///////// Перемещение ////////////
......@@ -1429,7 +1441,8 @@ CMathContent.prototype =
while ( null === TextPr && StartPos <= EndPos )
{
TextPr = this.content[StartPos].Get_CompiledTextPr(Copy);
TextPr = this.content[StartPos].Get_CompiledTextPr(true); // true для пустых ранов
// т.к. если пустой ран входит в селект, текстовый настройки не скопируются в ране
StartPos++;
}
......@@ -1468,6 +1481,11 @@ CMathContent.prototype =
var bSelectOneElement = this.Selection.Use && StartPos == EndPos;
var FirstPos = this.Selection.Use ? Math.min(StartPos, EndPos) : this.CurPos;
if(FirstPos == 0)
this.ParaMath.NeedCompiledCtrPr();
if( !this.Selection.Use || (bSelectOneElement && this.content[StartPos].Type == para_Math_Run) ) // TextPr меняем только в одном Run
{
var Pos = !this.Selection.Use ? this.CurPos : StartPos;
......@@ -1576,6 +1594,37 @@ CMathContent.prototype =
}
},
IsNormalTextInRuns: function()
{
var flag = true;
if(this.Selection.Use)
{
var StartPos = this.Selection.Start,
EndPos = this.Selection.End;
if ( StartPos > EndPos )
{
StartPos = this.Selection.End;
EndPos = this.Selection.Start;
}
for(var i = StartPos; i < EndPos+1; i++)
{
var curr = this.content[i],
currType = curr.Type;
if(currType == para_Math_Composition || (currType == para_Math_Run && false == curr.IsNormalText()))
{
flag = false;
break;
}
}
}
else
flag = false;
return flag;
},
Internal_Content_Add : function(Pos, Item, bUpdatePosition)
{
History.Add( this, { Type : historyitem_Math_AddItem, Pos : Pos, EndPos : Pos, Items : [ Item ] } );
......@@ -1608,7 +1657,13 @@ CMathContent.prototype =
ContentPos.Data[Depth]++;
}
},
NeedCompiledCtrPr: function()
{
for(var i = 0; i < this.content.length; i++)
if(this.content[i].Type == para_Math_Composition)
this.content[i].NeedCompiledCtrPr();
},
private_CorrectSelectionPos : function()
{
this.Selection.Start = Math.max(0, Math.min(this.content.length - 1, this.Selection.Start));
......
......@@ -539,7 +539,7 @@ CMathText.prototype =
this.Type = para_Math_Placeholder;
this.value = StartTextElement;
},
Resize: function(oMeasure, Parent, RPI)
Resize: function(oMeasure, RPI)
{
/*
var metricsTxt = g_oTextMeasurer.Measure2Code(letter);
......@@ -547,10 +547,10 @@ CMathText.prototype =
height = g_oTextMeasurer.GetHeight();
*/
if(!this.bJDraw)
/*if(!this.bJDraw)
this.Parent = Parent;
else
this.Parent = null;
this.Parent = null;*/
var letter = this.getCode();
......@@ -601,6 +601,13 @@ CMathText.prototype =
//this.RecalcInfo.NewLetter = false;
},
PreRecalc: function(Parent, ParaMath, ArgSize, RPI)
{
if(!this.bJDraw)
this.Parent = Parent;
else
this.Parent = null;
},
Get_WidthVisible: function()
{
return this.size.width;
......@@ -786,7 +793,7 @@ function CMathAmp()
this.pos = new CMathPosition();
this.AmpText = new CMathText(false);
this.AmpText = new CMathText(true);
this.AmpText.add(0x26);
this.size = null;
......@@ -794,9 +801,8 @@ function CMathAmp()
}
CMathAmp.prototype =
{
Resize: function(oMeasure, Parent, RPI)
Resize: function(oMeasure, RPI)
{
this.Parent = Parent;
this.bEqqArray = RPI.bEqqArray;
this.AmpText.Resize(oMeasure, this, RPI);
......@@ -821,6 +827,13 @@ CMathAmp.prototype =
}
},
PreRecalc: function(Parent, ParaMath, ArgSize, RPI)
{
if(!this.bJDraw)
this.Parent = Parent;
else
this.Parent = null;
},
Get_WidthVisible: function()
{
return this.size.width;
......
......@@ -242,12 +242,12 @@ CMatrixBase.prototype.recalculateSize = function(oMeasure, RPI)
this.RecalcInfo.bProps = false;
}
var txtPrp = this.Get_CompiledCtrPrp();
var FontSize = this.GetTPrpToControlLetter().FontSize;
var metrics = this.getMetrics();
if(this.nCol > 1)
{
var gapsCol = this.getLineGap(this.spaceColumn, txtPrp);
var gapsCol = this.getLineGap(this.spaceColumn, FontSize);
for(var i = 0; i < this.nCol - 1; i++)
this.gaps.column[i] = gapsCol;
......@@ -257,12 +257,12 @@ CMatrixBase.prototype.recalculateSize = function(oMeasure, RPI)
if(this.nRow > 1)
{
var intervalRow = this.getRowSpace(this.spaceRow, txtPrp);
var intervalRow = this.getRowSpace(this.spaceRow, FontSize);
var divCenter = 0;
var plH = 0.2743827160493827 * txtPrp.FontSize;
var minGp = this.spaceRow.minGap*txtPrp.FontSize*g_dKoef_pt_to_mm;
var plH = 0.2743827160493827*FontSize;
var minGp = this.spaceRow.minGap*FontSize*g_dKoef_pt_to_mm;
minGp -= plH;
for(var j = 0; j < this.nRow - 1; j++)
......@@ -355,7 +355,7 @@ CMatrixBase.prototype.setRuleGap = function(oSpace, rule, gap, minGap)
if(minGap == minGap - 0 && minGap == minGap^0)
oSpace.minGap = minGap;
};
CMatrixBase.prototype.getLineGap = function(spaceColumn, txtPrp)
CMatrixBase.prototype.getLineGap = function(spaceColumn, FontSize)
{
var spLine;
......@@ -377,9 +377,9 @@ CMatrixBase.prototype.getLineGap = function(spaceColumn, txtPrp)
if(spaceColumn.rule == 3)
lineGap = spLine*g_dKoef_pt_to_mm; //pt
else
lineGap = spLine*txtPrp.FontSize*g_dKoef_pt_to_mm; //em
lineGap = spLine*FontSize*g_dKoef_pt_to_mm; //em
var wPlh = 0.3241834852430555 * txtPrp.FontSize;
var wPlh = 0.3241834852430555*FontSize;
var min = spaceColumn.minGap / 20 * g_dKoef_pt_to_mm - wPlh;
lineGap = Math.max(lineGap, min);
......@@ -387,7 +387,7 @@ CMatrixBase.prototype.getLineGap = function(spaceColumn, txtPrp)
return lineGap;
};
CMatrixBase.prototype.getRowSpace = function(spaceRow, txtPrp)
CMatrixBase.prototype.getRowSpace = function(spaceRow, FontSize)
{
var spLine;
......@@ -409,10 +409,10 @@ CMatrixBase.prototype.getRowSpace = function(spaceRow, txtPrp)
if(spaceRow.rule == 3)
lineGap = spLine*g_dKoef_pt_to_mm; //pt
else
lineGap = spLine*txtPrp.FontSize*g_dKoef_pt_to_mm; //em
lineGap = spLine*FontSize*g_dKoef_pt_to_mm; //em
var min = spaceRow.minGap*txtPrp.FontSize*g_dKoef_pt_to_mm;
var min = spaceRow.minGap*FontSize*g_dKoef_pt_to_mm;
lineGap = Math.max(lineGap, min);
return lineGap;
......@@ -688,30 +688,22 @@ CEqArray.prototype.fillContent = function()
for (var nIndex = 0; nIndex < nRowsCount; nIndex++)
this.elements[nIndex][0] = this.Content[nIndex];
};
CEqArray.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CEqArray.prototype.Resize = function(oMeasure, RPI)
{
// на случай, чтобы не затереть массив
//var CurrAmperWPoints = RPI.AmperWPoints,
// CurrEqqArray = RPI.bEqqArray;
RPI.bEqqArray = true;
var NewRPI = RPI.Copy();
NewRPI.bEqqArray = true;
this.Parent = Parent;
this.ParaMath = ParaMath;
for(var i = 0; i < this.nRow; i++)
{
this.elements[i][0].Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.elements[i][0].Resize(oMeasure, NewRPI);
}
this.recalculateSize(oMeasure, RPI);
RPI.bEqqArray = false;
//RPI.AmperWPoints = CurrAmperWPoints;
//RPI.bEqqArray = CurrEqqArray;
//CEqArray.superclass.Resize.call(this, oMeasure, Parent, ParaMath, RPI, ArgSize);
this.recalculateSize(oMeasure);
}
CEqArray.prototype.getMetrics = function()
{
......
......@@ -147,7 +147,7 @@ Asc.extendClass(CNary, CMathBase);
CNary.prototype.ClassType = historyitem_type_nary;
CNary.prototype.kind = MATH_NARY;
CNary.prototype.init = function(props)
{
this.Fill_LogicalContent(3);
......@@ -207,7 +207,7 @@ CNary.prototype.fillBase = function(PropsInfo)
base.setBase(Sign);
base.setIterator(this.LowerIterator);
base.fillContent();
base.Set_CompiledCtrPrp(this.ParaMath);
//base.Set_CompiledCtrPrp(this.ParaMath);
}
else if( !PropsInfo.supHide && PropsInfo.subHide )
{
......@@ -217,7 +217,7 @@ CNary.prototype.fillBase = function(PropsInfo)
base.setIterator(this.UpperIterator);
base.fillContent();
base.Set_CompiledCtrPrp(this.ParaMath);
//base.Set_CompiledCtrPrp(this.ParaMath);
}
else if(PropsInfo.supHide && PropsInfo.subHide)
......@@ -233,15 +233,67 @@ CNary.prototype.fillBase = function(PropsInfo)
base.setUpperIterator(this.UpperIterator);
base.fillContent();
base.Set_CompiledCtrPrp(this.ParaMath);
//base.Set_CompiledCtrPrp(this.ParaMath);
}
}
this.Base = base;
this.addMCToContent( [base, this.Arg] );
}
CNary.prototype.ApplyProperties = function(RPI)
{
if(this.RecalcInfo.bProps || RPI.bChangeInline == true)
{
var oSign = this.getSign(this.Pr.chr, this.Pr.chrType);
this.Sign = oSign.operator;
var limLoc = this.Pr.limLoc;
if(RPI.bInline == true || RPI.bDecreasedComp == true)
{
limLoc = NARY_SubSup;
this.Sign = new CMathText(true);
this.Sign.add(oSign.chrCode);
}
if(limLoc == null || typeof(limLoc) == "undefined")
{
var bIntegral = oSign.chrCode > 0x222A && oSign.chrCode < 0x2231;
if(bIntegral)
limLoc = g_oMathSettings.intLim;
else
limLoc = g_oMathSettings.naryLim;
}
var PropsInfo =
{
limLoc : limLoc,
sign: this.Sign,
supHide: this.Pr.supHide,
subHide: this.Pr.subHide
};
// пока оставим так, chrType сейчас нигде не используется
this.Pr.chrType = oSign.chrType;
this.fillBase(PropsInfo);
this.RecalcInfo.bProps = false;
}
}
CNary.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
var NewRPI = RPI.Copy();
if(RPI.bInline || RPI.bDecreasedComp)
NewRPI.bNaryInline = true;
CNary.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSize, NewRPI, GapsInfo);
}
CNary.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
/*CNary.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
......@@ -298,7 +350,7 @@ CNary.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
this.Arg.Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.recalculateSize(oMeasure);
}
}*/
CNary.prototype.getSign = function(chrCode, chrType)
{
var result =
......@@ -417,7 +469,7 @@ CNary.prototype.setCtrPrp = function(txtPrp)
}
CNary.prototype.setDistance = function()
{
this.dW = this.Get_CompiledCtrPrp().FontSize/36*2.45;
this.dW = this.GetTPrpToControlLetter().FontSize/36*2.45;
}
CNary.prototype.getBase = function()
{
......@@ -444,7 +496,7 @@ function CNaryUnd(bInside)
Asc.extendClass(CNaryUnd, CMathBase);
CNaryUnd.prototype.setDistance = function()
{
var zetta = this.Get_CompiledCtrPrp().FontSize*25.4/96;
var zetta = this.GetTPrpToControlLetter().FontSize*25.4/96;
this.dH = zetta*0.25;
}
CNaryUnd.prototype.getAscent = function()
......@@ -455,19 +507,29 @@ CNaryUnd.prototype.getUpperIterator = function()
{
return this.elements[0][0];
}
CNaryUnd.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CNaryUnd.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
this.Set_CompiledCtrPrp(Parent, ParaMath);
var ArgSzUnd = ArgSize.Copy();
ArgSzUnd.decrease();
this.elements[0][0].Resize(oMeasure, this, ParaMath, RPI, ArgSzUnd);
this.elements[1][0].Resize(oMeasure, this, ParaMath, RPI, ArgSize);
var RPIUnd = RPI.Copy();
RPIUnd.bDecreasedComp = true;
this.recalculateSize(oMeasure);
this.elements[0][0].PreRecalc(this, ParaMath, ArgSzUnd, RPIUnd);
this.elements[1][0].PreRecalc(this, ParaMath, ArgSize, RPI);
}
/*CNaryUnd.prototype.Resize = function(oMeasure, RPI)
{
this.elements[0][0].Resize(oMeasure, RPI);
this.elements[1][0].Resize(oMeasure, RPI);
this.recalculateSize(oMeasure);
}*/
CNaryUnd.prototype.setBase = function(base)
{
this.elements[1][0] = base;
......@@ -487,10 +549,26 @@ function CNaryOvr(bInside)
Asc.extendClass(CNaryOvr, CMathBase);
CNaryOvr.prototype.old_setDistance = function()
{
var zetta = this.Get_CompiledCtrPrp().FontSize* 25.4/96;
var zetta = this.GetTPrpToControlLetter().FontSize* 25.4/96;
this.dH = zetta*0.1;
}
CNaryOvr.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CNaryOvr.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
this.Set_CompiledCtrPrp(Parent, ParaMath);
var ArgSzOvr = ArgSize.Copy();
ArgSzOvr.decrease();
var RPIOvr = RPI.Copy();
RPIOvr.bDecreasedComp = true;
this.elements[0][0].PreRecalc(this, ParaMath, ArgSize, RPI);
this.elements[1][0].PreRecalc(this, ParaMath, ArgSzOvr, RPIOvr);
}
/*CNaryOvr.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
......@@ -502,10 +580,10 @@ CNaryOvr.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
this.elements[1][0].Resize(oMeasure, this, ParaMath, RPI, ArgSzOvr);
this.recalculateSize(oMeasure);
}
}*/
CNaryOvr.prototype.recalculateSize = function()
{
var FontSize = this.Get_CompiledCtrPrp().FontSize;
var FontSize = this.GetTPrpToControlLetter().FontSize;
var zetta = FontSize*25.4/96;
var minGapBottom = zetta*0.1,
......@@ -550,7 +628,25 @@ function CNaryUndOvr(bInside)
this.setDimension(3,1);
}
Asc.extendClass(CNaryUndOvr, CMathBase);
CNaryUndOvr.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CNaryUndOvr.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
this.Set_CompiledCtrPrp(Parent, ParaMath);
var ArgSzIter = ArgSize.Copy();
ArgSzIter.decrease();
var RPI_Iter = RPI.Copy();
RPI_Iter.bDecreasedComp = true;
this.elements[0][0].PreRecalc(this, ParaMath, ArgSzIter, RPI_Iter);
this.elements[1][0].PreRecalc(this, ParaMath, ArgSize, RPI);
this.elements[2][0].PreRecalc(this, ParaMath, ArgSzIter, RPI_Iter);
}
/*CNaryUndOvr.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
......@@ -566,10 +662,10 @@ CNaryUndOvr.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize
this.elements[2][0].Resize(oMeasure, this, ParaMath, RPI, ArgSzOvr);
this.recalculateSize(oMeasure);
}
}*/
CNaryUndOvr.prototype.recalculateSize = function()
{
var FontSize = this.Get_CompiledCtrPrp().FontSize;
var FontSize = this.GetTPrpToControlLetter().FontSize;
var zetta = FontSize*25.4/96;
this.gapTop = zetta*0.25;
......@@ -666,7 +762,7 @@ CNaryOperator.prototype.drawGlyph = function(x, y,pGraphics)
YY = [];
//var textScale = this.getTxtPrp().FontSize/850; // 1000 pt
var textScale = this.Get_CompiledCtrPrp().FontSize/850; // 1000 pt
var textScale = this.GetTPrpToControlLetter().FontSize/850; // 1000 pt
var alpha = textScale*25.4/96 /64; // коэффициент; используется для того чтобы перевести координаты в миллиметры
// g_dKoef_px_to_mm = 25.4/96
......@@ -705,12 +801,18 @@ CNaryOperator.prototype.drawGlyph = function(x, y,pGraphics)
CNaryOperator.prototype.drawTextElem = function(x, y, pGraphics)
{
pGraphics.b_color1(0,0,0,255);
var rPrp = new CTextPr();
rPrp.Merge( this.Get_CompiledCtrPrp() );
rPrp.Italic = false;
rPrp.Bold = false;
pGraphics.SetFont(rPrp);
var ctrPrp = this.GetTPrpToControlLetter();
var Font =
{
FontSize: ctrPrp.FontSize,
FontFamily: {Name : ctrPrp.FontFamily.Name, Index : ctrPrp.FontFamily.Index},
Italic: false,
Bold: false //ctrPrp.Bold
};
pGraphics.SetFont(Font);
CNaryOperator.superclass.call.draw(this, x, y, pGraphics);
}
......@@ -729,20 +831,22 @@ CNaryOperator.prototype.recalculateSize = function()
var height = this.sizeGlyph.height,
width = this.sizeGlyph.width,
ascent = this.sizeGlyph.height/2 + DIV_CENT*this.Get_CompiledCtrPrp().FontSize;
ascent = this.sizeGlyph.height/2 + DIV_CENT*this.GetTPrpToControlLetter().FontSize;
this.size = {height: height, width: width, ascent: ascent};
}
CNaryOperator.prototype.Resize = function(oMeasure, Parent, ParaMath)
CNaryOperator.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
}
CNaryOperator.prototype.Resize = function(oMeasure, RPI)
{
this.recalculateSize(); //обычный пересчет, oMeasure не нужен
}
CNaryOperator.prototype.Get_CompiledCtrPrp = function()
CNaryOperator.prototype.GetTPrpToControlLetter = function()
{
return this.Parent.Get_CompiledCtrPrp();
return this.Parent.GetTPrpToControlLetter();
}
/*CNaryOperator.prototype.IsOnlyText = function()
{
......@@ -865,7 +969,7 @@ CSigma.prototype.getCoord = function()
//var textScale = this.getTxtPrp().FontSize/850; // 1000 pt
var textScale = this.Get_CompiledCtrPrp().FontSize/850; // 1000 pt
var textScale = this.GetTPrpToControlLetter().FontSize/850; // 1000 pt
var alpha = textScale*25.4/96 /64;
var h1 = Y[0] - Y[21],
......@@ -937,7 +1041,7 @@ CSigma.prototype.calculateSizeGlyph = function()
// пока размер не меняем в зависимости от высоты аргумента
//var betta = this.getTxtPrp().FontSize/36;
var betta = this.Get_CompiledCtrPrp().FontSize/36;
var betta = this.GetTPrpToControlLetter().FontSize/36;
var _width = 8.997900390624999*betta,
_height = 11.994444444444444*betta;
......@@ -1069,7 +1173,7 @@ CProduct.prototype.getCoord = function()
//var textScale = this.getTxtPrp().FontSize/850, // 1000 pt
var textScale = this.Get_CompiledCtrPrp().FontSize/850, // 1000 pt
var textScale = this.GetTPrpToControlLetter().FontSize/850, // 1000 pt
alpha = textScale*25.4/96 /64;
var h1 = Y[9],
......@@ -1100,7 +1204,7 @@ CProduct.prototype.getCoord = function()
CProduct.prototype.calculateSizeGlyph = function()
{
//var betta = this.getTxtPrp().FontSize/36;
var betta = this.Get_CompiledCtrPrp().FontSize/36;
var betta = this.GetTPrpToControlLetter().FontSize/36;
var _width = 10.312548828125*betta,
_height = 11.994444444444444*betta;
......@@ -1172,7 +1276,7 @@ CUnion.prototype.getCoord = function()
CUnion.prototype.calculateSizeGlyph = function()
{
//var betta = this.getTxtPrp().FontSize/36;
var betta = this.Get_CompiledCtrPrp().FontSize/36;
var betta = this.GetTPrpToControlLetter().FontSize/36;
this.gap = 0.93*betta;
var _width = 9.38*betta,
......@@ -1291,7 +1395,7 @@ CLogicalOr.prototype.getCoord = function()
X[7] = 0; Y[7] = 0;
//var textScale = this.getTxtPrp().FontSize/850, // 1000 pt
var textScale = this.Get_CompiledCtrPrp().FontSize/850, // 1000 pt
var textScale = this.GetTPrpToControlLetter().FontSize/850, // 1000 pt
alpha = textScale*25.4/96 /64;
var w1 = X[1],
......@@ -1323,7 +1427,7 @@ CLogicalOr.prototype.getCoord = function()
CLogicalOr.prototype.calculateSizeGlyph = function()
{
//var betta = this.getTxtPrp().FontSize/36;
var betta = this.Get_CompiledCtrPrp().FontSize/36;
var betta = this.GetTPrpToControlLetter().FontSize/36;
var _width = 9.6159*betta,
_height = 11.994444444444444*betta;
......@@ -1553,7 +1657,7 @@ CIntegral.prototype.old_drawPath = function(XX, YY)
CIntegral.prototype.calculateSizeGlyph = function()
{
//var betta = this.getTxtPrp().FontSize/36;
var betta = this.Get_CompiledCtrPrp().FontSize/36;
var betta = this.GetTPrpToControlLetter().FontSize/36;
var _width = 8.624*betta,
_height = 13.7*betta;
......@@ -1594,7 +1698,7 @@ CDoubleIntegral.prototype.drawPath = function(pGraphics, XX, YY)
CDoubleIntegral.prototype.calculateSizeGlyph = function()
{
//var betta = this.getTxtPrp().FontSize/36;
var betta = this.Get_CompiledCtrPrp().FontSize/36;
var betta = this.GetTPrpToControlLetter().FontSize/36;
var _width = 14.2296*betta,
_height = 13.7*betta;
......@@ -1645,7 +1749,7 @@ CTripleIntegral.prototype.drawPath = function(pGraphics, XX, YY)
CTripleIntegral.prototype.calculateSizeGlyph = function()
{
//var betta = this.getTxtPrp().FontSize/36;
var betta = this.Get_CompiledCtrPrp().FontSize/36;
var betta = this.GetTPrpToControlLetter().FontSize/36;
var _width = 18.925368*betta,
_height = 13.7*betta;
......@@ -2009,7 +2113,7 @@ CContourIntegral.prototype.draw = function(x, y, pGraphics)
HH = coord2.H;
//var textScale = this.getTxtPrp().FontSize/850;// 1000 pt
var FontSize = this.Get_CompiledCtrPrp().FontSize;
var FontSize = this.GetTPrpToControlLetter().FontSize;
var textScale = FontSize/850;// 1000 pt
var alpha = textScale*25.4/96 /64; // коэффициент; используется для того чтобы перевести координаты в миллиметры
......@@ -2057,7 +2161,7 @@ CContourIntegral.prototype.draw = function(x, y, pGraphics)
CContourIntegral.prototype.calculateSizeGlyph = function()
{
//var betta = this.getTxtPrp().FontSize/36;
var betta = this.Get_CompiledCtrPrp().FontSize/36;
var betta = this.GetTPrpToControlLetter().FontSize/36;
var _width = 8.624*betta,
_height = 13.7*betta;
......@@ -2094,7 +2198,7 @@ CSurfaceIntegral.prototype.draw = function(x, y, pGraphics)
WW = 1.6*coord2.W,
HH = coord2.H;
var FontSize = this.Get_CompiledCtrPrp().FontSize;
var FontSize = this.GetTPrpToControlLetter().FontSize;
var textScale = FontSize/850; // 1000 pt
var alpha = textScale*25.4/96 /64; // коэффициент; используется для того чтобы перевести координаты в миллиметры
......@@ -2142,7 +2246,7 @@ CSurfaceIntegral.prototype.draw = function(x, y, pGraphics)
CSurfaceIntegral.prototype.calculateSizeGlyph = function()
{
//var betta = this.getTxtPrp().FontSize/36;
var betta = this.Get_CompiledCtrPrp().FontSize/36;
var betta = this.GetTPrpToControlLetter().FontSize/36;
var _width = 14.2296*betta,
_height = 13.7*betta;
......@@ -2178,7 +2282,7 @@ CVolumeIntegral.prototype.draw = function(x, y, pGraphics)
WW = 2.1*coord2.W,
HH = coord2.H;
var FontSize = this.Get_CompiledCtrPrp().FontSize;
var FontSize = this.GetTPrpToControlLetter().FontSize;
var textScale = FontSize/850; // 1000 pt
var alpha = textScale*25.4/96 /64; // коэффициент; используется для того чтобы перевести координаты в миллиметры
......@@ -2225,7 +2329,7 @@ CVolumeIntegral.prototype.draw = function(x, y, pGraphics)
CVolumeIntegral.prototype.calculateSizeGlyph = function()
{
//var betta = this.getTxtPrp().FontSize/36;
var betta = this.Get_CompiledCtrPrp().FontSize/36;
var betta = this.GetTPrpToControlLetter().FontSize/36;
var _width = 18.925368*betta,
_height = 13.7*betta;
......
......@@ -403,11 +403,11 @@ CGlyphOperator.prototype.drawOnlyLines = function(x, y, pGraphics)
}
CGlyphOperator.prototype.getCtrPrp = function()
{
return this.Parent.Get_CompiledCtrPrp();
return this.Parent.GetTPrpToControlLetter();
}
CGlyphOperator.prototype.relate = function(parent)
CGlyphOperator.prototype.PreRecalc = function(Parent)
{
this.Parent = parent;
this.Parent = Parent;
}
......@@ -2937,16 +2937,19 @@ COperator.prototype.draw = function(x, y, pGraphics)
{
// выставляем font, если нужно отрисовать текст
pGraphics.b_color1(0,0,0,255);
var ctrPrp = this.Get_CompiledCtrPrp();
var rPrp = new CTextPr();
//var defaultRPrp = this.Parent.Composition.DEFAULT_RUN_PRP;
var defaultRPrp = this.Parent.ParaMath.Get_Default_TPrp();
rPrp.Merge(defaultRPrp);
rPrp.Merge(ctrPrp);
rPrp.Italic = false;
rPrp.Bold = false;
pGraphics.SetFont(rPrp);
var ctrPrp = this.GetTPrpToControlLetter();
var Font =
{
FontSize: ctrPrp.FontSize,
FontFamily: {Name : ctrPrp.FontFamily.Name, Index : ctrPrp.FontFamily.Index},
Italic: false,
Bold: false
};
pGraphics.SetFont(Font);
////////////////////////////////////////////////
......@@ -3017,24 +3020,25 @@ COperator.prototype.IsLineGlyph = function()
{
return this.typeOper == ACCENT_LINE || this.typeOper == ACCENT_DOUBLE_LINE;
}
COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch)
COperator.prototype.fixSize = function(oMeasure, stretch)
{
this.ParaMath = ParaMath;
if(this.typeOper !== OPERATOR_EMPTY)
{
var width, height, ascent;
var dims;
var ctrPrp = this.Get_CompiledCtrPrp();
var ctrPrp = this.GetTPrpToControlLetter();
var rPrp = new CTextPr();
var defaultRPrp = this.Parent.ParaMath.Get_Default_TPrp();
var Font =
{
FontSize: ctrPrp.FontSize,
FontFamily: {Name : ctrPrp.FontFamily.Name, Index : ctrPrp.FontFamily.Index},
Italic: false,
Bold: false //ctrPrp.Bold
};
rPrp.Merge(defaultRPrp);
rPrp.Merge(ctrPrp);
rPrp.Italic = false;
oMeasure.SetFont(rPrp);
oMeasure.SetFont(Font);
var bLine = this.IsLineGlyph();
......@@ -3096,8 +3100,8 @@ COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch)
// Ascent
var mgCtrPrp = this.Parent.Get_CompiledCtrPrp();
var shCenter = this.Parent.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp);
var mgCtrPrp = this.Parent.GetTPrpToControlLetter();
var shCenter = this.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp);
if(!bLine && (this.operator.loc == LOCATION_TOP || this.operator.loc == LOCATION_BOT))
ascent = dims.Height/2;
......@@ -3162,30 +3166,28 @@ COperator.prototype.IsJustDraw = function()
{
return true;
}
COperator.prototype.Resize = function(Parent, ParaMath, oMeasure)
COperator.prototype.Resize = function(oMeasure)
{
this.ParaMath = ParaMath;
this.Parent = Parent;
if(this.typeOper !== OPERATOR_EMPTY)
{
var bHor = this.operator.loc == 0 || this.operator.loc == 1;
if(bHor)
this.fixSize(ParaMath, oMeasure, this.size.width);
this.fixSize(oMeasure, this.size.width);
else
this.fixSize(ParaMath, oMeasure, this.size.height);
this.fixSize(oMeasure, this.size.height);
}
}
COperator.prototype.relate = function(parent)
COperator.prototype.PreRecalc = function(Parent, ParaMath)
{
this.Parent = parent;
this.Parent = Parent;
this.ParaMath = ParaMath;
if(this.typeOper !== OPERATOR_EMPTY)
this.operator.relate(this);
this.operator.PreRecalc(this); // в данном случае mathText нужен только один параметр
}
COperator.prototype.Get_CompiledCtrPrp = function()
COperator.prototype.GetTPrpToControlLetter = function()
{
return this.Parent.Get_CompiledCtrPrp();
return this.Parent.GetTPrpToControlLetter();
}
COperator.prototype.getChr = function()
{
......@@ -3235,8 +3237,8 @@ CMathDelimiterPr.prototype.Set_FromObject = function(Obj)
if(DELIMITER_SHAPE_MATH === Obj.shp || DELIMITER_SHAPE_CENTERED === Obj.shp)
this.shp = Obj.shp;
if(true === Obj.grow || 1 === Obj.grow)
this.grow = true;
if(false === Obj.grow || 0 === Obj.grow)
this.grow = false;
if(undefined !== Obj.column && null !== Obj.column)
this.column = Obj.column;
......@@ -3421,12 +3423,8 @@ CDelimiter.prototype.fillContent = function()
for (var nIndex = 0; nIndex < nColumnsCount; nIndex++)
this.elements[0][nIndex] = this.Content[nIndex];
}
CDelimiter.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CDelimiter.prototype.ApplyProperties = function(RPI)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
if(this.RecalcInfo.bProps == true)
{
var begPrp =
......@@ -3442,7 +3440,6 @@ CDelimiter.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
chr: 0x28
};
this.begOper.mergeProperties(begPrp, begDefaultPrp);
this.begOper.relate(this);
var endPrp =
{
......@@ -3458,7 +3455,6 @@ CDelimiter.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
};
this.endOper.mergeProperties(endPrp, endDefaultPrp);
this.endOper.relate(this);
var sepPrp =
{
......@@ -3477,12 +3473,22 @@ CDelimiter.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
sepPrp.type = OPERATOR_EMPTY;
this.sepOper.mergeProperties(sepPrp, sepDefaultPrp);
this.sepOper.relate(this);
this.RecalcInfo.bProps = false;
}
}
CDelimiter.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
this.ApplyProperties(RPI);
this.begOper.PreRecalc(this, ParaMath);
this.endOper.PreRecalc(this, ParaMath);
this.sepOper.PreRecalc(this, ParaMath);
CDelimiter.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSize, RPI, GapsInfo);
}
CDelimiter.prototype.Resize = function(oMeasure, RPI)
{
// размеры аргумента
var heightG = 0, widthG = 0,
ascentG = 0, descentG = 0;
......@@ -3491,7 +3497,7 @@ CDelimiter.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
for(var j = 0; j < this.nCol; j++)
{
this.elements[0][j].Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.elements[0][j].Resize(oMeasure, RPI);
var content = this.elements[0][j].size;
widthG += content.width;
ascentG = content.ascent > ascentG ? content.ascent : ascentG;
......@@ -3500,7 +3506,7 @@ CDelimiter.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
heightG = ascentG + descentG;
var mgCtrPrp = this.Get_CompiledCtrPrp();
var mgCtrPrp = this.GetTPrpToControlLetter();
var shCenter = this.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp);
var maxAD = ascentG - shCenter > descentG + shCenter ? ascentG - shCenter: descentG + shCenter;
......@@ -3514,9 +3520,9 @@ CDelimiter.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
var heightStretch = b2Max && !bTextContent ? 2*maxAD : ascentG + descentG;
this.begOper.fixSize(ParaMath, oMeasure, heightStretch);
this.endOper.fixSize(ParaMath, oMeasure, heightStretch);
this.sepOper.fixSize(ParaMath, oMeasure, heightStretch);
this.begOper.fixSize(oMeasure, heightStretch);
this.endOper.fixSize(oMeasure, heightStretch);
this.sepOper.fixSize(oMeasure, heightStretch);
// Общая ширина
var width = widthG + this.begOper.size.width + this.endOper.size.width + (this.nCol - 1)*this.sepOper.size.width;
......@@ -3732,30 +3738,19 @@ CDelimiter.prototype.getBase = function(numb)
function CCharacter()
{
this.operator = new COperator(OPER_GROUP_CHAR);
CMathBase.call(this);
}
Asc.extendClass(CCharacter, CMathBase);
CCharacter.prototype.setCharacter = function(props, defaultProps)
{
this.operator.mergeProperties(props, defaultProps);
this.operator.relate(this);
//this.setDimension(1, 1);
//this.setContent();
}
CCharacter.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CCharacter.prototype.Resize = function(oMeasure, RPI)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
var base = this.elements[0][0];
base.Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.operator.fixSize(ParaMath, oMeasure, base.size.width);
base.Resize(oMeasure, RPI);
var ctrPrp = this.Get_CompiledCtrPrp();
oMeasure.SetFont(ctrPrp);
this.operator.fixSize(oMeasure, base.size.width);
var width = base.size.width > this.operator.size.width ? base.size.width : this.operator.size.width,
height = base.size.height + this.operator.size.height,
......@@ -3807,17 +3802,18 @@ CCharacter.prototype.draw = function(x, y, pGraphics)
{
this.elements[0][0].draw(x, y, pGraphics);
var mgCtrPrp = this.Get_CompiledCtrPrp();
var FontSize = mgCtrPrp.FontSize,
FontFamily = {Name: "Cambria Math", Index: -1};
var ctrPrp = this.GetTPrpToControlLetter();
var obj = {FontSize: FontSize, FontFamily: FontFamily};
var accFont = new CTextPr();
accFont.Set_FromObject(obj);
var Font =
{
FontSize: ctrPrp.FontSize,
FontFamily: {Name : ctrPrp.FontFamily.Name, Index : ctrPrp.FontFamily.Index},
Italic: false,
Bold: false
};
pGraphics.SetFont(accFont);
pGraphics.SetFont(Font);
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
......@@ -3848,7 +3844,6 @@ CMathGroupChrPr.prototype.Set_FromObject = function(Obj)
if(LOCATION_TOP === Obj.pos || LOCATION_BOT === Obj.pos)
this.pos = Obj.pos;
};
CMathGroupChrPr.prototype.Copy = function()
{
var NewPr = new CMathGroupChrPr();
......@@ -3947,7 +3942,7 @@ CGroupCharacter.prototype.init = function(props)
this.setProperties(props);
this.fillContent();
}
CGroupCharacter.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CGroupCharacter.prototype.ApplyProperties = function(RPI)
{
if(this.RecalcInfo.bProps == true)
{
......@@ -3967,27 +3962,35 @@ CGroupCharacter.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, Arg
this.setCharacter(operProps, operDefaultPrp);
this.RecalcInfo.bProps = false;
}
var ArgSz = ArgSize.Copy();
if(this.Pr.pos == this.Pr.vertJc)
{
ArgSz.decrease();
if(this.Pr.pos == this.Pr.vertJc)
{
var Iterator;
var Iterator;
if(this.Pr.pos == LOCATION_TOP)
Iterator = new CDenominator(this.getBase());
else
Iterator = new CNumerator(this.getBase());
if(this.Pr.pos == LOCATION_TOP)
Iterator = new CDenominator(this.getBase());
this.elements[0][0] = Iterator;
}
else
Iterator = new CNumerator(this.getBase());
this.elements[0][0] = this.getBase();
this.elements[0][0] = Iterator;
}
else
this.elements[0][0] = this.getBase();
}
CGroupCharacter.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
this.ApplyProperties(RPI);
this.operator.PreRecalc(this, ParaMath);
var ArgSz = ArgSize.Copy();
if(this.Pr.pos == this.Pr.vertJc)
ArgSz.decrease();
CGroupCharacter.superclass.Resize.call(this, oMeasure, Parent, ParaMath, RPI, ArgSz);
CGroupCharacter.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSz, RPI, GapsInfo);
}
CGroupCharacter.prototype.getBase = function()
{
......@@ -4004,7 +4007,7 @@ CGroupCharacter.prototype.getAscent = function(oMeasure)
//var shCent = DIV_CENT*this.getCtrPrp().FontSize;
var ctrPrp = this.Get_CompiledCtrPrp();
var ctrPrp = this.GetTPrpToControlLetter();
var shCent = this.ParaMath.GetShiftCenter(oMeasure, ctrPrp);
if(this.Pr.vertJc === VJUST_TOP && this.Pr.pos === LOCATION_TOP)
......
......@@ -439,11 +439,31 @@ CRadical.prototype.fillContent = function()
this.Iterator = this.getDegree();
this.Base = this.getBase();
};
CRadical.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
CRadical.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{
this.Parent = Parent;
this.ParaMath = ParaMath;
this.Set_CompiledCtrPrp(Parent, ParaMath);
this.ApplyProperties(RPI);
if(this.Pr.type == SQUARE_RADICAL)
this.RealBase.PreRecalc(this, ParaMath, ArgSize, RPI);
else
{
var ArgSzIter = new CMathArgSize();
ArgSzIter.SetValue(-2);
this.Iterator.PreRecalc(this, ParaMath, ArgSzIter, RPI);
this.RealBase.PreRecalc(this, ParaMath, ArgSize, RPI);
}
if(this.bInside == false)
GapsInfo.setGaps(this, this.TextPrControlLetter.FontSize);
}
CRadical.prototype.ApplyProperties = function(RPI)
{
if(this.RecalcInfo.bProps)
{
if(this.Pr.degHide == true)
......@@ -490,20 +510,16 @@ CRadical.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
this.RecalcInfo.bProps = false;
}
//this.Set_CompiledCtrPrp(ParaMath);
}
CRadical.prototype.Resize = function(oMeasure, RPI)
{
if(this.Pr.type == SQUARE_RADICAL)
this.RealBase.Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.RealBase.Resize(oMeasure, RPI);
else
{
var ArgSzIter = new CMathArgSize();
ArgSzIter.SetValue(-2);
//ArgSzIter.Merge(ArgSize);
this.Iterator.Resize(oMeasure, this, ParaMath, RPI, ArgSzIter);
this.RealBase.Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.Iterator.Resize(oMeasure, RPI);
this.RealBase.Resize(oMeasure, RPI);
}
var shTop,
......
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