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() ...@@ -58,7 +58,7 @@ function ParaMath()
this.DefaultTextPr = new CTextPr(); this.DefaultTextPr = new CTextPr();
this.DefaultTextPr.Italic = true; this.DefaultTextPr.FontSize = 11;
this.DefaultTextPr.FontFamily = {Name : "Cambria Math", Index : -1 }; this.DefaultTextPr.FontFamily = {Name : "Cambria Math", Index : -1 };
this.DefaultTextPr.RFonts.Set_All("Cambria Math", -1); this.DefaultTextPr.RFonts.Set_All("Cambria Math", -1);
...@@ -150,13 +150,13 @@ ParaMath.prototype.Get_CompiledTextPr = function(Copy) ...@@ -150,13 +150,13 @@ ParaMath.prototype.Get_CompiledTextPr = function(Copy)
{ {
// TODO: ParaMath.Get_CompiledTextPr // TODO: ParaMath.Get_CompiledTextPr
var TextPr = new CTextPr(); //var TextPr = new CTextPr();
var oContent = this.GetSelectContent(); var oContent = this.GetSelectContent();
var mTextPr = oContent.Content.Get_CompiledTextPr(Copy); var mTextPr = oContent.Content.Get_CompiledTextPr(Copy);
TextPr.Merge( mTextPr ); //TextPr.Merge( mTextPr );
return TextPr; return mTextPr;
}; };
ParaMath.prototype.Add = function(Item) ParaMath.prototype.Add = function(Item)
...@@ -379,11 +379,23 @@ ParaMath.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll) ...@@ -379,11 +379,23 @@ ParaMath.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll)
else else
{ {
var content = this.GetSelectContent().Content; 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); content.Apply_TextPr(TextPr, IncFontSize, ApplyToAll);
}
TextPr.FontSize = FontSize;
}
}; };
ParaMath.prototype.Clear_TextPr = function() ParaMath.prototype.Clear_TextPr = function()
{ {
...@@ -522,7 +534,8 @@ ParaMath.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) ...@@ -522,7 +534,8 @@ ParaMath.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
if(RPI.NeedResize) 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 придется перерасчитывать // когда формула будеат разбиваться на строки, Position придется перерасчитывать
var pos = new CMathPosition(); var pos = new CMathPosition();
pos.x = 0; pos.x = 0;
...@@ -900,7 +913,11 @@ ParaMath.prototype.SetInline = function(value) ...@@ -900,7 +913,11 @@ ParaMath.prototype.SetInline = function(value)
ParaMath.prototype.SetNeedResize = function() ParaMath.prototype.SetNeedResize = function()
{ {
this.NeedResize = true; this.NeedResize = true;
} };
ParaMath.prototype.NeedCompiledCtrPr = function()
{
this.Root.NeedCompiledCtrPr();
};
ParaMath.prototype.MathToImageConverter= function() ParaMath.prototype.MathToImageConverter= function()
{ {
window.IsShapeToImageConverter = true; window.IsShapeToImageConverter = true;
...@@ -1497,6 +1514,7 @@ ParaMath.prototype.Split = function (ContentPos, Depth) ...@@ -1497,6 +1514,7 @@ ParaMath.prototype.Split = function (ContentPos, Depth)
if(this.Root.content[Pos].Type == para_Math_Run) if(this.Root.content[Pos].Type == para_Math_Run)
{ {
NewParaMath = new ParaMath(); NewParaMath = new ParaMath();
NewParaMath.Jc = this.Jc;
var NewRun = this.Root.content[Pos].Split(ContentPos, Depth+1); var NewRun = this.Root.content[Pos].Split(ContentPos, Depth+1);
NewParaMath.Root.Add_ToContent(0, NewRun); NewParaMath.Root.Add_ToContent(0, NewRun);
......
...@@ -7793,7 +7793,7 @@ ParaRun.prototype.Math_Draw = function(x, y, pGraphics) ...@@ -7793,7 +7793,7 @@ ParaRun.prototype.Math_Draw = function(x, y, pGraphics)
for(var i=0; i < this.Content.length;i++) for(var i=0; i < this.Content.length;i++)
this.Content[i].draw(X, Y, pGraphics); 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 // пересчет элементов контента в Run
// Recalculate_MeasureContent // Recalculate_MeasureContent
...@@ -7809,8 +7809,8 @@ ParaRun.prototype.Math_Recalculate = function(oMeasure, Parent, Paragraph, RPI, ...@@ -7809,8 +7809,8 @@ ParaRun.prototype.Math_Recalculate = function(oMeasure, Parent, Paragraph, RPI,
var RangeEndPos = this.Content.length; var RangeEndPos = this.Content.length;
this.Paragraph = Paragraph; //this.Paragraph = Paragraph;
this.Parent = Parent; //this.Parent = Parent;
// обновляем позиции start и end для Range // обновляем позиции start и end для Range
//this.Lines[0].Add_Range(0, RangeStartPos, RangeEndPos); //this.Lines[0].Add_Range(0, RangeStartPos, RangeEndPos);
...@@ -7857,7 +7857,7 @@ ParaRun.prototype.Math_Recalculate = function(oMeasure, Parent, Paragraph, RPI, ...@@ -7857,7 +7857,7 @@ ParaRun.prototype.Math_Recalculate = function(oMeasure, Parent, Paragraph, RPI,
for (var i = 0 ; i < Lng; i++) 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; var oSize = this.Content[i].size;
...@@ -7951,6 +7951,21 @@ ParaRun.prototype.Math_SetGaps = function(GapsInfo) ...@@ -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() ParaRun.prototype.IsPlaceholder = function()
{ {
return this.Content.length == 1 && this.Content[0].IsPlaceholder(); return this.Content.length == 1 && this.Content[0].IsPlaceholder();
...@@ -8004,6 +8019,10 @@ ParaRun.prototype.Math_GetInfoLetter = function(Info) ...@@ -8004,6 +8019,10 @@ ParaRun.prototype.Math_GetInfoLetter = function(Info)
else else
Info.Result = false; Info.Result = false;
} }
ParaRun.IsNormalText = function()
{
return this.MathPrp.nor === true;
}
function CParaRunStartState(Run) function CParaRunStartState(Run)
{ {
......
...@@ -22,7 +22,7 @@ function CAccentCircumflex() ...@@ -22,7 +22,7 @@ function CAccentCircumflex()
Asc.extendClass(CAccentCircumflex, CGlyphOperator); Asc.extendClass(CAccentCircumflex, CGlyphOperator);
CAccentCircumflex.prototype.calcSize = function(stretch) 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 width = 3.88*alpha;
var height = 3.175*alpha; var height = 3.175*alpha;
...@@ -40,7 +40,7 @@ CAccentCircumflex.prototype.calcSize = function(stretch) ...@@ -40,7 +40,7 @@ CAccentCircumflex.prototype.calcSize = function(stretch)
} }
CAccentCircumflex.prototype.calcCoord = 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; //var penW = fontSize*g_dKoef_pt_to_mm*this.PEN_W;
//penW *= 96/25.4; //penW *= 96/25.4;
...@@ -126,7 +126,7 @@ function CAccentLine() ...@@ -126,7 +126,7 @@ function CAccentLine()
Asc.extendClass(CAccentLine, CGlyphOperator); Asc.extendClass(CAccentLine, CGlyphOperator);
CAccentLine.prototype.calcSize = function(stretch) 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 height = 1.68*alpha;
var width = 4.938*alpha; var width = 4.938*alpha;
...@@ -135,37 +135,9 @@ CAccentLine.prototype.calcSize = function(stretch) ...@@ -135,37 +135,9 @@ CAccentLine.prototype.calcSize = function(stretch)
return {width: width, height: height}; 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) 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 penW = fontSize*0.067 * 25.4/96;
var x1 = x + 25.4/96, var x1 = x + 25.4/96,
...@@ -184,7 +156,7 @@ function CAccentDoubleLine() ...@@ -184,7 +156,7 @@ function CAccentDoubleLine()
Asc.extendClass(CAccentDoubleLine, CGlyphOperator); Asc.extendClass(CAccentDoubleLine, CGlyphOperator);
CAccentDoubleLine.prototype.calcSize = function(stretch) 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 height = 2.843*alpha;
var width = 4.938*alpha; var width = 4.938*alpha;
...@@ -205,7 +177,7 @@ CAccentDoubleLine.prototype.calcSize = function(stretch) ...@@ -205,7 +177,7 @@ CAccentDoubleLine.prototype.calcSize = function(stretch)
} }
CAccentDoubleLine.prototype.old_calcCoord = function(stretch) CAccentDoubleLine.prototype.old_calcCoord = function(stretch)
{ {
var fontSize = this.Parent.Get_CompiledCtrPrp().FontSize; var fontSize = this.Parent.GetTPrpToControlLetter().FontSize;
var X = [], var X = [],
Y = []; Y = [];
...@@ -246,7 +218,7 @@ CAccentDoubleLine.prototype.old_drawPath = function(pGraphics, XX, YY) ...@@ -246,7 +218,7 @@ CAccentDoubleLine.prototype.old_drawPath = function(pGraphics, XX, YY)
} }
CAccentDoubleLine.prototype.draw = function(x, y, pGraphics) CAccentDoubleLine.prototype.draw = function(x, y, pGraphics)
{ {
var fontSize = this.Parent.Get_CompiledCtrPrp().FontSize; var fontSize = this.Parent.GetTPrpToControlLetter().FontSize;
var diff = this.diff; var diff = this.diff;
...@@ -273,7 +245,7 @@ function CAccentTilde() ...@@ -273,7 +245,7 @@ function CAccentTilde()
Asc.extendClass(CAccentTilde, CGlyphOperator); Asc.extendClass(CAccentTilde, CGlyphOperator);
CAccentTilde.prototype.calcSize = function(stretch) 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 width = 9.047509765625*betta; // реальная на отрисовке width 7.495282031249999
var height = 2.469444444444444*betta; var height = 2.469444444444444*betta;
...@@ -326,7 +298,7 @@ CAccentTilde.prototype.calcCoord = function(stretch) ...@@ -326,7 +298,7 @@ CAccentTilde.prototype.calcCoord = function(stretch)
var XX = [], var XX = [],
YY = []; YY = [];
var fontSize = this.Parent.Get_CompiledCtrPrp().FontSize; var fontSize = this.Parent.GetTPrpToControlLetter().FontSize;
var textScale = fontSize/1000, // 1000 pt var textScale = fontSize/1000, // 1000 pt
alpha = textScale*25.4/96 /64 ; // g_dKoef_px_to_mm = 25.4/96 alpha = textScale*25.4/96 /64 ; // g_dKoef_px_to_mm = 25.4/96
...@@ -373,7 +345,7 @@ function CAccentBreve() ...@@ -373,7 +345,7 @@ function CAccentBreve()
Asc.extendClass(CAccentBreve, CGlyphOperator); Asc.extendClass(CAccentBreve, CGlyphOperator);
CAccentBreve.prototype.calcSize = function(stretch) 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 width = 4.2333333333333325*betta;
var height = 2.469444444444445*betta; var height = 2.469444444444445*betta;
...@@ -413,7 +385,7 @@ CAccentBreve.prototype.calcCoord = function(stretch) ...@@ -413,7 +385,7 @@ CAccentBreve.prototype.calcCoord = function(stretch)
var XX = [], var XX = [],
YY = []; YY = [];
var fontSize = this.Parent.Get_CompiledCtrPrp().FontSize; var fontSize = this.Parent.GetTPrpToControlLetter().FontSize;
var textScale = fontSize/1000, // 1000 pt var textScale = fontSize/1000, // 1000 pt
alpha = textScale*25.4/96 /64 ; // g_dKoef_px_to_mm = 25.4/96 alpha = textScale*25.4/96 /64 ; // g_dKoef_px_to_mm = 25.4/96
...@@ -567,13 +539,8 @@ CAccent.prototype.setPosition = function(pos, PosInfo) ...@@ -567,13 +539,8 @@ CAccent.prototype.setPosition = function(pos, PosInfo)
this.elements[0][0].setPosition(PosBase, 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) if(this.RecalcInfo.bProps == true)
{ {
var prp = var prp =
...@@ -583,25 +550,26 @@ CAccent.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize) ...@@ -583,25 +550,26 @@ CAccent.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
loc: LOCATION_TOP loc: LOCATION_TOP
}; };
var defaultPrp = var defaultPrp = {type: ACCENT_CIRCUMFLEX };
{
type: ACCENT_CIRCUMFLEX
};
this.operator.mergeProperties(prp, defaultPrp); this.operator.mergeProperties(prp, defaultPrp);
this.RecalcInfo.bProps = false; 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); CAccent.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSize, RPI, GapsInfo);
}
var base = this.elements[0][0]; CAccent.prototype.Resize = function(oMeasure, RPI)
base.Resize(oMeasure, this, ParaMath, RPI, ArgSize); {
var base = this.getBase();
var ctrPrp = this.Get_CompiledCtrPrp(); base.Resize(oMeasure, RPI);
oMeasure.SetFont(ctrPrp);
this.operator.fixSize(ParaMath, oMeasure, base.size.width); this.operator.fixSize(oMeasure, base.size.width);
var width = base.size.width, // (!) var width = base.size.width, // (!)
height = base.size.height + this.operator.size.height, height = base.size.height + this.operator.size.height,
......
...@@ -13,6 +13,7 @@ function CMathBase(bInside) ...@@ -13,6 +13,7 @@ function CMathBase(bInside)
this.CtrPrp = new CTextPr(); this.CtrPrp = new CTextPr();
this.CompiledCtrPrp = new CTextPr(); this.CompiledCtrPrp = new CTextPr();
this.TextPrControlLetter = new CTextPr();
this.ArgSize = new CMathArgSize(); this.ArgSize = new CMathArgSize();
...@@ -97,7 +98,6 @@ CMathBase.prototype = ...@@ -97,7 +98,6 @@ CMathBase.prototype =
if(txtPrp !== null && typeof(txtPrp) !== "undefined") if(txtPrp !== null && typeof(txtPrp) !== "undefined")
{ {
this.CtrPrp.Merge(txtPrp); this.CtrPrp.Merge(txtPrp);
this.CtrPrp.FontFamily = {Name : "Cambria Math", Index : -1 };
} }
}, },
Get_CtrPrp: function() Get_CtrPrp: function()
...@@ -110,6 +110,16 @@ CMathBase.prototype = ...@@ -110,6 +110,16 @@ CMathBase.prototype =
return CtrPrp; 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) /*Set_CompiledCtrPrp: function(ParaMath)
{ {
var defaultRPrp = ParaMath.GetFirstRPrp(); var defaultRPrp = ParaMath.GetFirstRPrp();
...@@ -125,7 +135,7 @@ CMathBase.prototype = ...@@ -125,7 +135,7 @@ CMathBase.prototype =
},*/ },*/
Get_CompiledCtrPrp: function() Get_CompiledCtrPrp: function()
{ {
this.Set_CompiledCtrPrp(this.ParaMath); this.Set_CompiledCtrPrp(this.Parent, this.ParaMath);
var CompiledCtrPrp; var CompiledCtrPrp;
...@@ -145,7 +155,7 @@ CMathBase.prototype = ...@@ -145,7 +155,7 @@ CMathBase.prototype =
}, },
Get_CompiledCtrPrp_2: function() // without arg Size Get_CompiledCtrPrp_2: function() // without arg Size
{ {
this.Set_CompiledCtrPrp(this.ParaMath); this.Set_CompiledCtrPrp(this.Parent, this.ParaMath);
var CompiledCtrPrp; var CompiledCtrPrp;
...@@ -172,12 +182,11 @@ CMathBase.prototype = ...@@ -172,12 +182,11 @@ CMathBase.prototype =
}, },
// для управляющих символов в приоритете GetFirstRunPrp // для управляющих символов в приоритете GetFirstRunPrp
// если первый элемент - мат объект, то берутся его CtrPrp // если первый элемент - мат объект, то берутся его CtrPrp
getPrpToControlLetter: function() GetTPrpToControlLetter: function()
{ {
var rPrp = new CTextPr(); this.Set_CompiledCtrPrp(this.Parent, this.ParaMath);
rPrp.Merge( this.ParaMath.GetFirstRPrp() );
return rPrp; return this.TextPrControlLetter;
}, },
fillPlaceholders: function() fillPlaceholders: function()
{ {
...@@ -344,6 +353,26 @@ CMathBase.prototype = ...@@ -344,6 +353,26 @@ CMathBase.prototype =
{ {
return this.Parent.remove(order); 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) recalculateSize: function(oMeasure, RPI)
{ {
var width = 0; var width = 0;
...@@ -366,20 +395,16 @@ CMathBase.prototype = ...@@ -366,20 +395,16 @@ CMathBase.prototype =
width += this.dW*(this.nCol - 1) + this.GapLeft + this.GapRight; 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}; 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 i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++) 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); this.recalculateSize(oMeasure, RPI);
}, },
...@@ -390,7 +415,58 @@ CMathBase.prototype = ...@@ -390,7 +415,58 @@ CMathBase.prototype =
if(!this.elements[i][j].IsJustDraw()) if(!this.elements[i][j].IsJustDraw())
this.elements[i][j].Resize_2(oMeasure, this, ParaMath, RPI, ArgSize); 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) if(this.RecalcInfo.bCtrPrp == true)
{ {
...@@ -488,8 +564,8 @@ CMathBase.prototype = ...@@ -488,8 +564,8 @@ CMathBase.prototype =
}, },
SetGaps: function(GapsInfo) SetGaps: function(GapsInfo)
{ {
this.Parent = GapsInfo.Parent; //this.Parent = GapsInfo.Parent;
this.ParaMath = GapsInfo.ParaMath; //this.ParaMath = GapsInfo.ParaMath;
GapsInfo.Left = GapsInfo.Current; GapsInfo.Left = GapsInfo.Current;
...@@ -566,6 +642,9 @@ CMathBase.prototype = ...@@ -566,6 +642,9 @@ CMathBase.prototype =
}, },
Apply_TextPr: function(TextPr, IncFontSize, ApplyToAll) Apply_TextPr: function(TextPr, IncFontSize, ApplyToAll)
{ {
if(ApplyToAll == true)
this.RecalcInfo.bCtrPrp = true;
if(TextPr == undefined) if(TextPr == undefined)
{ {
var CtrPrp = this.Get_CompiledCtrPrp_2(); var CtrPrp = this.Get_CompiledCtrPrp_2();
......
"use strict"; "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() function CMathBorderBoxPr()
{ {
this.hideBot = false; this.hideBot = false;
...@@ -139,7 +152,7 @@ CBorderBox.prototype.recalculateSize = function() ...@@ -139,7 +152,7 @@ CBorderBox.prototype.recalculateSize = function()
var height = base.height; var height = base.height;
var ascent = base.ascent; var ascent = base.ascent;
this.gapBrd = this.Get_CompiledCtrPrp().FontSize*0.08104587131076388; this.gapBrd = this.GetTPrpToControlLetter().FontSize*0.08104587131076388;
if(this.Pr.hideTop == false) if(this.Pr.hideTop == false)
{ {
...@@ -162,7 +175,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics) ...@@ -162,7 +175,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
{ {
this.elements[0][0].draw(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, var Width = this.size.width - this.GapLeft - this.GapRight,
Height = this.size.height; Height = this.size.height;
...@@ -523,28 +536,24 @@ CBar.prototype.fillContent = function() ...@@ -523,28 +536,24 @@ CBar.prototype.fillContent = function()
this.setDimension(1, 1); this.setDimension(1, 1);
this.elements[0][0] = this.getBase(); 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) if(this.RecalcInfo.bProps == true)
{ {
var prp = var prp = {loc: this.Pr.pos, type: DELIMITER_LINE };
{
loc: this.Pr.pos,
type: DELIMITER_LINE
};
var defaultProps = var defaultProps = { loc: LOCATION_BOT};
{
loc: LOCATION_BOT
};
this.setCharacter(prp, defaultProps); this.setCharacter(prp, defaultProps);
this.RecalcInfo.bProps = false; 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.PreRecalc.call(this, Parent, ParaMath, ArgSize, RPI, GapsInfo);
CBar.superclass.Resize.call(this, oMeasure, Parent, ParaMath, RPI, ArgSize);
} }
CBar.prototype.getAscent = function() CBar.prototype.getAscent = function()
{ {
......
...@@ -46,6 +46,7 @@ function CDegreeBase(props, bInside) ...@@ -46,6 +46,7 @@ function CDegreeBase(props, bInside)
if(props !== null && typeof(props) !== "undefined") if(props !== null && typeof(props) !== "undefined")
this.init(props); this.init(props);
//CDegreeBase.prototype.init.call(this, props);
} }
Asc.extendClass(CDegreeBase, CMathBase); Asc.extendClass(CDegreeBase, CMathBase);
CDegreeBase.prototype.init = function(props) CDegreeBase.prototype.init = function(props)
...@@ -59,19 +60,41 @@ CDegreeBase.prototype.fillContent = function() ...@@ -59,19 +60,41 @@ CDegreeBase.prototype.fillContent = function()
this.elements[0][0] = this.baseContent; this.elements[0][0] = this.baseContent;
this.elements[0][1] = this.iterContent; 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.Parent = Parent;
this.ParaMath = ParaMath; 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(); var ArgSzDegr = ArgSize.Copy();
ArgSzDegr.decrease(); 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) if(this.Pr.type === DEGREE_SUPERSCRIPT)
this.recalculateSup(oMeasure); this.recalculateSup(oMeasure);
...@@ -83,24 +106,20 @@ CDegreeBase.prototype.recalculateSup = function(oMeasure) ...@@ -83,24 +106,20 @@ CDegreeBase.prototype.recalculateSup = function(oMeasure)
var base = this.elements[0][0].size, var base = this.elements[0][0].size,
iter = this.elements[0][1].size; iter = this.elements[0][1].size;
var mgCtrPrp = this.Get_CompiledCtrPrp(); var mgCtrPrp = this.GetTPrpToControlLetter();
var shCenter = this.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp); var shCenter = this.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp);
this.upBase = 0; this.upBase = 0;
this.upIter = 0; this.upIter = 0;
var oBase = this.elements[0][0]; var oBase = this.elements[0][0];
//var bBaseOnlyText = oBase.IsJustDraw() ? false : oBase.IsOnlyText(); // у Just-Draw элементов нет ф-ии IsOnlyText
var bOneLineText = oBase.IsJustDraw() ? false : oBase.IsOneLineText(); var bOneLineText = oBase.IsJustDraw() ? false : oBase.IsOneLineText();
if(bOneLineText) if(bOneLineText)
{ {
//var UpBaseline = 1.786*shCenter; // baseline итератора
var UpBaseline = 1.65*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) if(iter.height - UpBaseline - iter.ascent + base.ascent > 2/3 * base.ascent)
this.upBase = iter.height - 2/3*base.ascent; this.upBase = iter.height - 2/3*base.ascent;
else if(UpBaseline + iter.ascent > base.ascent) else if(UpBaseline + iter.ascent > base.ascent)
...@@ -138,15 +157,13 @@ CDegreeBase.prototype.recalculateSubScript = function(oMeasure) ...@@ -138,15 +157,13 @@ CDegreeBase.prototype.recalculateSubScript = function(oMeasure)
var base = this.elements[0][0].size, var base = this.elements[0][0].size,
iter = this.elements[0][1].size; iter = this.elements[0][1].size;
var mgCtrPrp = this.Get_CompiledCtrPrp(); var mgCtrPrp = this.GetTPrpToControlLetter();
var shCenter = this.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp); var shCenter = this.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp);
var width = base.width + iter.width + this.dW; var width = base.width + iter.width + this.dW;
width += this.GapLeft + this.GapRight; width += this.GapLeft + this.GapRight;
var oBase = this.elements[0][0]; var oBase = this.elements[0][0];
//var bBaseOnlyText = oBase.IsJustDraw() ? false : oBase.IsOnlyText(); // у Just-Draw элементов нет ф-ии IsOnlyText
var bOneLineText = oBase.IsJustDraw() ? false : oBase.IsOneLineText(); var bOneLineText = oBase.IsJustDraw() ? false : oBase.IsOneLineText();
if(bOneLineText) if(bOneLineText)
...@@ -278,6 +295,24 @@ CIterators.prototype.init = function() ...@@ -278,6 +295,24 @@ CIterators.prototype.init = function()
this.elements[0][0] = this.iterUp; this.elements[0][0] = this.iterUp;
this.elements[1][0] = this.iterDn; 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() CIterators.prototype.getUpperIterator = function()
{ {
return this.elements[0][0]; return this.elements[0][0];
...@@ -294,10 +329,6 @@ CIterators.prototype.setLowerIterator = function(iterator) ...@@ -294,10 +329,6 @@ CIterators.prototype.setLowerIterator = function(iterator)
{ {
this.elements[1][0] = iterator; this.elements[1][0] = iterator;
}; };
CIterators.prototype.Get_CompiledCtrPrp = function()
{
return this.Parent.Get_CompiledCtrPrp();
};
CIterators.prototype.alignIterators = function(mcJc) CIterators.prototype.alignIterators = function(mcJc)
{ {
this.alignment.wdt[0] = mcJc; this.alignment.wdt[0] = mcJc;
...@@ -354,6 +385,7 @@ function CDegreeSubSupBase(props, bInside) ...@@ -354,6 +385,7 @@ function CDegreeSubSupBase(props, bInside)
CDegreeSubSupBase.superclass.constructor.call(this, bInside); CDegreeSubSupBase.superclass.constructor.call(this, bInside);
this.gapBase = 0; this.gapBase = 0;
this.bNaryInline = false;
this.Pr = new CMathDegreeSubSupPr(); this.Pr = new CMathDegreeSubSupPr();
...@@ -392,7 +424,29 @@ CDegreeSubSupBase.prototype.fillContent = function() ...@@ -392,7 +424,29 @@ CDegreeSubSupBase.prototype.fillContent = function()
oIters.alignIterators(MCJC_RIGHT); 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.Parent = Parent;
this.ParaMath = ParaMath; this.ParaMath = ParaMath;
...@@ -406,10 +460,14 @@ CDegreeSubSupBase.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, A ...@@ -406,10 +460,14 @@ CDegreeSubSupBase.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, A
this.iters.Resize(oMeasure, this, ParaMath, RPI, ArgSzIters); this.iters.Resize(oMeasure, this, ParaMath, RPI, ArgSzIters);
this.recalculateSize(oMeasure, RPI); this.recalculateSize(oMeasure, RPI);
}; };*/
CDegreeSubSupBase.prototype.recalculateSize = function(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); var shCenter = this.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp);
shCenter *= 1.4; shCenter *= 1.4;
...@@ -433,16 +491,17 @@ CDegreeSubSupBase.prototype.recalculateSize = function(oMeasure, RPI) ...@@ -433,16 +491,17 @@ CDegreeSubSupBase.prototype.recalculateSize = function(oMeasure, RPI)
iterDown = iters.elements[1][0].size; iterDown = iters.elements[1][0].size;
var lUp = base.size.ascent - shCenter; // center of base 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 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 shIter = this.ParaMath.GetShiftCenter(oMeasure, ctrPrpIter); //смещение
var minGap = 0.7*shIter; var minGap = 0.7*shIter;
var up, down; var up, down;
if(RPI.bNaryInline == true) if(this.bNaryInline)
{ {
up = down = 0; up = down = 0;
} }
...@@ -467,7 +526,6 @@ CDegreeSubSupBase.prototype.recalculateSize = function(oMeasure, RPI) ...@@ -467,7 +526,6 @@ CDegreeSubSupBase.prototype.recalculateSize = function(oMeasure, RPI)
} }
if(up + down > minGap) if(up + down > minGap)
{ {
this.gapBase = iterUp.height + up - lUp; this.gapBase = iterUp.height + up - lUp;
......
...@@ -75,9 +75,7 @@ CFraction.prototype.draw = function(x, y, pGraphics) ...@@ -75,9 +75,7 @@ CFraction.prototype.draw = function(x, y, pGraphics)
} }
CFraction.prototype.drawBarFraction = function(x, y, pGraphics) CFraction.prototype.drawBarFraction = function(x, y, pGraphics)
{ {
//var mgCtrPrp = this.Get_CompiledCtrPrp(); var mgCtrPrp = this.GetTPrpToControlLetter();
var mgCtrPrp = this.Get_CompiledCtrPrp_2();
mgCtrPrp.FontSize = this.ParaMath.ApplyArgSize(mgCtrPrp.FontSize, this.Parent.Get_CompiledArgSize().value);
var penW = mgCtrPrp.FontSize* 25.4/96 * 0.08; var penW = mgCtrPrp.FontSize* 25.4/96 * 0.08;
...@@ -102,8 +100,7 @@ CFraction.prototype.drawBarFraction = function(x, y, pGraphics) ...@@ -102,8 +100,7 @@ CFraction.prototype.drawBarFraction = function(x, y, pGraphics)
} }
CFraction.prototype.drawSkewedFraction = function(x, y, pGraphics) CFraction.prototype.drawSkewedFraction = function(x, y, pGraphics)
{ {
//var ctrPrp = this.Get_CompiledCtrPrp(); var mgCtrPrp = this.GetTPrpToControlLetter();
var mgCtrPrp = this.Get_CompiledCtrPrp();
var penW = mgCtrPrp.FontSize/12.5*g_dKoef_pix_to_mm; var penW = mgCtrPrp.FontSize/12.5*g_dKoef_pix_to_mm;
...@@ -208,8 +205,7 @@ CFraction.prototype.drawLinearFraction = function(x, y, pGraphics) ...@@ -208,8 +205,7 @@ CFraction.prototype.drawLinearFraction = function(x, y, pGraphics)
x2 = X + this.elements[0][0].size.width + shift, x2 = X + this.elements[0][0].size.width + shift,
y2 = Y + this.size.height; y2 = Y + this.size.height;
//var ctrPrp = this.Get_CompiledCtrPrp(); var mgCtrPrp = this.GetTPrpToControlLetter();
var mgCtrPrp = this.Get_CompiledCtrPrp();
var penW = mgCtrPrp.FontSize/12.5*g_dKoef_pix_to_mm; var penW = mgCtrPrp.FontSize/12.5*g_dKoef_pix_to_mm;
pGraphics.SetFont(mgCtrPrp); pGraphics.SetFont(mgCtrPrp);
...@@ -247,7 +243,45 @@ CFraction.prototype.getDenominator = function() ...@@ -247,7 +243,45 @@ CFraction.prototype.getDenominator = function()
return denominator; 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(); var ArgSzFr = ArgSize.Copy();
...@@ -265,6 +299,8 @@ CFraction.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize) ...@@ -265,6 +299,8 @@ CFraction.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
this.ArgSize.SetValue(0); this.ArgSize.SetValue(0);
} }
// ??!!
if(this.Pr.type == NO_BAR_FRACTION) if(this.Pr.type == NO_BAR_FRACTION)
{ {
ArgSzFr.decrease(); ArgSzFr.decrease();
...@@ -279,10 +315,11 @@ CFraction.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize) ...@@ -279,10 +315,11 @@ CFraction.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
//this.Set_CompiledCtrPrp(ParaMath); //this.Set_CompiledCtrPrp(ParaMath);
var NewRPI = RPI.Copy(); 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.superclass.Resize.call(this, oMeasure, Parent, ParaMath, NewRPI, ArgSzFr);
} }*/
CFraction.prototype.recalculateSize = function(oMeasure) CFraction.prototype.recalculateSize = function(oMeasure)
{ {
if(this.Pr.type == BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION) if(this.Pr.type == BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION)
...@@ -297,8 +334,7 @@ CFraction.prototype.recalculateBarFraction = function(oMeasure) ...@@ -297,8 +334,7 @@ CFraction.prototype.recalculateBarFraction = function(oMeasure)
var num = this.elements[0][0].size, var num = this.elements[0][0].size,
den = this.elements[1][0].size; den = this.elements[1][0].size;
//var ctrPrp = this.Get_CompiledCtrPrp(); var mgCtrPrp = this.GetTPrpToControlLetter();
var mgCtrPrp = this.Get_CompiledCtrPrp();
var width = num.width > den.width ? num.width : den.width; var width = num.width > den.width ? num.width : den.width;
var height = num.height + den.height; var height = num.height + den.height;
...@@ -310,8 +346,7 @@ CFraction.prototype.recalculateBarFraction = function(oMeasure) ...@@ -310,8 +346,7 @@ CFraction.prototype.recalculateBarFraction = function(oMeasure)
} }
CFraction.prototype.recalculateSkewed = function(oMeasure) CFraction.prototype.recalculateSkewed = function(oMeasure)
{ {
//var ctrPrp = this.Get_CompiledCtrPrp(); var mgCtrPrp = this.GetTPrpToControlLetter();
var mgCtrPrp = this.Get_CompiledCtrPrp();
//this.gapSlash = 5.011235894097222 * mgCtrPrp.FontSize/36; //this.gapSlash = 5.011235894097222 * mgCtrPrp.FontSize/36;
this.dW = 5.011235894097222 * mgCtrPrp.FontSize/36; this.dW = 5.011235894097222 * mgCtrPrp.FontSize/36;
...@@ -331,8 +366,8 @@ CFraction.prototype.recalculateLinear = function() ...@@ -331,8 +366,8 @@ CFraction.prototype.recalculateLinear = function()
DescentSecond = this.elements[0][1].size.height - this.elements[0][1].size.ascent; DescentSecond = this.elements[0][1].size.height - this.elements[0][1].size.ascent;
var H = AscentFirst + DescentSecond; 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; var gap = 5.011235894097222*mgCtrPrp.FontSize/36;
...@@ -428,7 +463,7 @@ CFractionBase.prototype.init = function(MathContent) ...@@ -428,7 +463,7 @@ CFractionBase.prototype.init = function(MathContent)
this.setDimension(1, 1); this.setDimension(1, 1);
this.elements[0][0] = MathContent; 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.Parent = Parent;
this.ParaMath = ParaMath; this.ParaMath = ParaMath;
...@@ -438,7 +473,7 @@ CFractionBase.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSi ...@@ -438,7 +473,7 @@ CFractionBase.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSi
this.elements[0][0].Resize(oMeasure, this, ParaMath, RPI, ArgSize); this.elements[0][0].Resize(oMeasure, this, ParaMath, RPI, ArgSize);
this.recalculateSize(); this.recalculateSize();
} }*/
CFractionBase.prototype.getElement = function() CFractionBase.prototype.getElement = function()
{ {
return this.elements[0][0]; return this.elements[0][0];
...@@ -465,7 +500,7 @@ CNumerator.prototype.recalculateSize = function() ...@@ -465,7 +500,7 @@ CNumerator.prototype.recalculateSize = function()
{ {
var arg = this.elements[0][0].size; var arg = this.elements[0][0].size;
var mgCtrPrp = this.Get_CompiledCtrPrp(); var mgCtrPrp = this.GetTPrpToControlLetter();
var Descent = arg.height - arg.ascent; // baseLine var Descent = arg.height - arg.ascent; // baseLine
...@@ -517,7 +552,7 @@ CDenominator.prototype.recalculateSize = function() ...@@ -517,7 +552,7 @@ CDenominator.prototype.recalculateSize = function()
{ {
var arg = this.elements[0][0].size; 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; var Ascent = arg.ascent - 4.938888888888888*mgCtrPrp.FontSize/36;
......
...@@ -30,6 +30,87 @@ CMathLimitPr.prototype.Read_FromBinary = function(Reader) ...@@ -30,6 +30,87 @@ CMathLimitPr.prototype.Read_FromBinary = function(Reader)
this.type = Reader.GetLong(); 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) function CLimit(props)
{ {
CLimit.superclass.constructor.call(this); CLimit.superclass.constructor.call(this);
...@@ -67,121 +148,35 @@ CLimit.prototype.getIterator = function() ...@@ -67,121 +148,35 @@ CLimit.prototype.getIterator = function()
{ {
return this.Content[1]; 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) if(this.RecalcInfo.bProps == true || RPI.bChangeInline == true)
{ {
this.setDimension(1, 1);
if(RPI.bInline == true && RPI.bMathFunc == true) if(RPI.bInline == true && RPI.bMathFunc == true)
{ {
this.setDimension(1, 1);
var props; var props;
if(this.Pr.type == LIMIT_LOW) if(this.Pr.type == LIMIT_LOW)
{ props = {type: DEGREE_SUBSCRIPT, ctrPrp: this.CtrPrp};
props =
{
type: DEGREE_SUBSCRIPT,
ctrPrp: this.CtrPrp
};
}
else else
{ props = {type: DEGREE_SUPERSCRIPT, ctrPrp: this.CtrPrp};
props =
{ this.elements[0][0] = new CDegreeBase(props, true);
type: DEGREE_SUPERSCRIPT,
ctrPrp: this.CtrPrp
};
}
this.elements[0][0] = new CDegreeBase(null, true);
this.elements[0][0].setBase(this.getFName()); this.elements[0][0].setBase(this.getFName());
this.elements[0][0].setIterator(this.getIterator()); this.elements[0][0].setIterator(this.getIterator());
this.elements[0][0].fillContent(); this.elements[0][0].fillContent();
this.FName = this.getFName();
this.Iterator = this.getIterator();
} }
else else
{ {
this.setDimension(2, 1); this.elements[0][0] = new CLimitPrimary(true, this.Pr.type, this.getFName(), this.getIterator());
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.RecalcInfo.bProps = false; 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) function CMathFunc(props)
{ {
CMathFunc.superclass.constructor.call(this); CMathFunc.superclass.constructor.call(this);
...@@ -207,18 +202,16 @@ CMathFunc.prototype.init = function(props) ...@@ -207,18 +202,16 @@ CMathFunc.prototype.init = function(props)
this.setProperties(props); this.setProperties(props);
this.fillContent(); this.fillContent();
} }
CMathFunc.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize) CMathFunc.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{ {
RPI.bMathFunc = true; var NewRPI = RPI.Copy();
NewRPI.bMathFunc = true;
CMathFunc.superclass.Resize.call(this, oMeasure, Parent, ParaMath, RPI, ArgSize);
RPI.bMathFunc = false;
CMathFunc.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSize, NewRPI, GapsInfo);
} }
CMathFunc.prototype.setDistance = function() 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() CMathFunc.prototype.getFName = function()
{ {
......
This diff is collapsed.
...@@ -539,7 +539,7 @@ CMathText.prototype = ...@@ -539,7 +539,7 @@ CMathText.prototype =
this.Type = para_Math_Placeholder; this.Type = para_Math_Placeholder;
this.value = StartTextElement; this.value = StartTextElement;
}, },
Resize: function(oMeasure, Parent, RPI) Resize: function(oMeasure, RPI)
{ {
/* /*
var metricsTxt = g_oTextMeasurer.Measure2Code(letter); var metricsTxt = g_oTextMeasurer.Measure2Code(letter);
...@@ -547,10 +547,10 @@ CMathText.prototype = ...@@ -547,10 +547,10 @@ CMathText.prototype =
height = g_oTextMeasurer.GetHeight(); height = g_oTextMeasurer.GetHeight();
*/ */
if(!this.bJDraw) /*if(!this.bJDraw)
this.Parent = Parent; this.Parent = Parent;
else else
this.Parent = null; this.Parent = null;*/
var letter = this.getCode(); var letter = this.getCode();
...@@ -601,6 +601,13 @@ CMathText.prototype = ...@@ -601,6 +601,13 @@ CMathText.prototype =
//this.RecalcInfo.NewLetter = false; //this.RecalcInfo.NewLetter = false;
}, },
PreRecalc: function(Parent, ParaMath, ArgSize, RPI)
{
if(!this.bJDraw)
this.Parent = Parent;
else
this.Parent = null;
},
Get_WidthVisible: function() Get_WidthVisible: function()
{ {
return this.size.width; return this.size.width;
...@@ -786,7 +793,7 @@ function CMathAmp() ...@@ -786,7 +793,7 @@ function CMathAmp()
this.pos = new CMathPosition(); this.pos = new CMathPosition();
this.AmpText = new CMathText(false); this.AmpText = new CMathText(true);
this.AmpText.add(0x26); this.AmpText.add(0x26);
this.size = null; this.size = null;
...@@ -794,9 +801,8 @@ function CMathAmp() ...@@ -794,9 +801,8 @@ function CMathAmp()
} }
CMathAmp.prototype = CMathAmp.prototype =
{ {
Resize: function(oMeasure, Parent, RPI) Resize: function(oMeasure, RPI)
{ {
this.Parent = Parent;
this.bEqqArray = RPI.bEqqArray; this.bEqqArray = RPI.bEqqArray;
this.AmpText.Resize(oMeasure, this, RPI); this.AmpText.Resize(oMeasure, this, RPI);
...@@ -821,6 +827,13 @@ CMathAmp.prototype = ...@@ -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() Get_WidthVisible: function()
{ {
return this.size.width; return this.size.width;
......
...@@ -242,12 +242,12 @@ CMatrixBase.prototype.recalculateSize = function(oMeasure, RPI) ...@@ -242,12 +242,12 @@ CMatrixBase.prototype.recalculateSize = function(oMeasure, RPI)
this.RecalcInfo.bProps = false; this.RecalcInfo.bProps = false;
} }
var txtPrp = this.Get_CompiledCtrPrp(); var FontSize = this.GetTPrpToControlLetter().FontSize;
var metrics = this.getMetrics(); var metrics = this.getMetrics();
if(this.nCol > 1) 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++) for(var i = 0; i < this.nCol - 1; i++)
this.gaps.column[i] = gapsCol; this.gaps.column[i] = gapsCol;
...@@ -257,12 +257,12 @@ CMatrixBase.prototype.recalculateSize = function(oMeasure, RPI) ...@@ -257,12 +257,12 @@ CMatrixBase.prototype.recalculateSize = function(oMeasure, RPI)
if(this.nRow > 1) if(this.nRow > 1)
{ {
var intervalRow = this.getRowSpace(this.spaceRow, txtPrp); var intervalRow = this.getRowSpace(this.spaceRow, FontSize);
var divCenter = 0; var divCenter = 0;
var plH = 0.2743827160493827 * txtPrp.FontSize; var plH = 0.2743827160493827*FontSize;
var minGp = this.spaceRow.minGap*txtPrp.FontSize*g_dKoef_pt_to_mm; var minGp = this.spaceRow.minGap*FontSize*g_dKoef_pt_to_mm;
minGp -= plH; minGp -= plH;
for(var j = 0; j < this.nRow - 1; j++) for(var j = 0; j < this.nRow - 1; j++)
...@@ -355,7 +355,7 @@ CMatrixBase.prototype.setRuleGap = function(oSpace, rule, gap, minGap) ...@@ -355,7 +355,7 @@ CMatrixBase.prototype.setRuleGap = function(oSpace, rule, gap, minGap)
if(minGap == minGap - 0 && minGap == minGap^0) if(minGap == minGap - 0 && minGap == minGap^0)
oSpace.minGap = minGap; oSpace.minGap = minGap;
}; };
CMatrixBase.prototype.getLineGap = function(spaceColumn, txtPrp) CMatrixBase.prototype.getLineGap = function(spaceColumn, FontSize)
{ {
var spLine; var spLine;
...@@ -377,9 +377,9 @@ CMatrixBase.prototype.getLineGap = function(spaceColumn, txtPrp) ...@@ -377,9 +377,9 @@ CMatrixBase.prototype.getLineGap = function(spaceColumn, txtPrp)
if(spaceColumn.rule == 3) if(spaceColumn.rule == 3)
lineGap = spLine*g_dKoef_pt_to_mm; //pt lineGap = spLine*g_dKoef_pt_to_mm; //pt
else 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; var min = spaceColumn.minGap / 20 * g_dKoef_pt_to_mm - wPlh;
lineGap = Math.max(lineGap, min); lineGap = Math.max(lineGap, min);
...@@ -387,7 +387,7 @@ CMatrixBase.prototype.getLineGap = function(spaceColumn, txtPrp) ...@@ -387,7 +387,7 @@ CMatrixBase.prototype.getLineGap = function(spaceColumn, txtPrp)
return lineGap; return lineGap;
}; };
CMatrixBase.prototype.getRowSpace = function(spaceRow, txtPrp) CMatrixBase.prototype.getRowSpace = function(spaceRow, FontSize)
{ {
var spLine; var spLine;
...@@ -409,10 +409,10 @@ CMatrixBase.prototype.getRowSpace = function(spaceRow, txtPrp) ...@@ -409,10 +409,10 @@ CMatrixBase.prototype.getRowSpace = function(spaceRow, txtPrp)
if(spaceRow.rule == 3) if(spaceRow.rule == 3)
lineGap = spLine*g_dKoef_pt_to_mm; //pt lineGap = spLine*g_dKoef_pt_to_mm; //pt
else 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); lineGap = Math.max(lineGap, min);
return lineGap; return lineGap;
...@@ -688,30 +688,22 @@ CEqArray.prototype.fillContent = function() ...@@ -688,30 +688,22 @@ CEqArray.prototype.fillContent = function()
for (var nIndex = 0; nIndex < nRowsCount; nIndex++) for (var nIndex = 0; nIndex < nRowsCount; nIndex++)
this.elements[nIndex][0] = this.Content[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, //var CurrAmperWPoints = RPI.AmperWPoints,
// CurrEqqArray = RPI.bEqqArray; // 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++) 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); this.recalculateSize(oMeasure);
RPI.bEqqArray = false;
//RPI.AmperWPoints = CurrAmperWPoints;
//RPI.bEqqArray = CurrEqqArray;
//CEqArray.superclass.Resize.call(this, oMeasure, Parent, ParaMath, RPI, ArgSize);
} }
CEqArray.prototype.getMetrics = function() CEqArray.prototype.getMetrics = function()
{ {
......
This diff is collapsed.
This diff is collapsed.
...@@ -439,11 +439,31 @@ CRadical.prototype.fillContent = function() ...@@ -439,11 +439,31 @@ CRadical.prototype.fillContent = function()
this.Iterator = this.getDegree(); this.Iterator = this.getDegree();
this.Base = this.getBase(); 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.Parent = Parent;
this.ParaMath = ParaMath; 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.RecalcInfo.bProps)
{ {
if(this.Pr.degHide == true) if(this.Pr.degHide == true)
...@@ -490,20 +510,16 @@ CRadical.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize) ...@@ -490,20 +510,16 @@ CRadical.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
this.RecalcInfo.bProps = false; this.RecalcInfo.bProps = false;
} }
}
//this.Set_CompiledCtrPrp(ParaMath); CRadical.prototype.Resize = function(oMeasure, RPI)
{
if(this.Pr.type == SQUARE_RADICAL) if(this.Pr.type == SQUARE_RADICAL)
this.RealBase.Resize(oMeasure, this, ParaMath, RPI, ArgSize); this.RealBase.Resize(oMeasure, RPI);
else else
{ {
var ArgSzIter = new CMathArgSize(); this.Iterator.Resize(oMeasure, RPI);
ArgSzIter.SetValue(-2); this.RealBase.Resize(oMeasure, RPI);
//ArgSzIter.Merge(ArgSize);
this.Iterator.Resize(oMeasure, this, ParaMath, RPI, ArgSzIter);
this.RealBase.Resize(oMeasure, this, ParaMath, RPI, ArgSize);
} }
var shTop, 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