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

1. Поправила gaps для delimiters

2. Убрала LinesPositions, LinesWidths из ParaMath
3. Реализовала Bounds для контенов и мат объектов
4. Реализоавала рамку и подсветку дл многострочных формул
5. Поправила баг для delimiters : неправильно операторы выравнивались в случае текстовых элементов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61744 954022d7-b5bf-4e40-9824-e11837661b57
parent eab59fee
...@@ -217,8 +217,7 @@ function ParaMath() ...@@ -217,8 +217,7 @@ function ParaMath()
this.Y = 0; this.Y = 0;
this.FirstPage = -1; this.FirstPage = -1;
this.LinesWidths = []; // в тч для отрисовки рамки //this.Bounds = [];
this.LinesPositions = [];
this.CurPageInfo = this.CurPageInfo =
{ {
...@@ -449,12 +448,22 @@ ParaMath.prototype.Get_AlignToLine = function(_CurLine, _CurRange, Page, _X, _XL ...@@ -449,12 +448,22 @@ ParaMath.prototype.Get_AlignToLine = function(_CurLine, _CurRange, Page, _X, _XL
_XLimit -= MathSettings.Get_RightMargin(this.State); _XLimit -= MathSettings.Get_RightMargin(this.State);
var Jc = this.Get_Align(); var Jc = this.Get_Align();
var FirstWidth = CurrentPage == 0 ? this.LinesWidths[0] : 0; // если страница не первая, то ширину первой строки формулы не учитываем
var WidthFirstLine = 0;
var LineCount = this.Root.protected_GetLinesCount();
if(LineCount > 0)
WidthFirstLine = this.Root.GetWidth(_CurLine);
/*if(this.Bounds.length > 0)
WidthFirstLine = this.Bounds[0].W;*/
var FirstWidth = CurrentPage == 0 ? WidthFirstLine : 0; // если страница не первая, то ширину первой строки формулы не учитываем
var W = 0; var W = 0;
var MaxW = this.CurPageInfo.MaxLineW; var MaxW = this.CurPageInfo.MaxLineW;
var LineCount = this.Root.protected_GetLinesCount();
if(LineCount == 1) // чтобы не сравнивать с wrapIndent, когда формула занимает одну строку if(LineCount == 1) // чтобы не сравнивать с wrapIndent, когда формула занимает одну строку
W = FirstWidth; W = FirstWidth;
...@@ -856,7 +865,6 @@ ParaMath.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) ...@@ -856,7 +865,6 @@ ParaMath.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
this.FirstPage = Page; this.FirstPage = Page;
this.CurPageInfo.Page = -1; this.CurPageInfo.Page = -1;
this.LinesWidths.length = 0;
} }
// пока будем каждый раз обновлять информацию (т.к. когда не inline формула становиться inline может получиться так, что пересчет для первой строки не придет) // пока будем каждый раз обновлять информацию (т.к. когда не inline формула становиться inline может получиться так, что пересчет для первой строки не придет)
...@@ -887,7 +895,6 @@ ParaMath.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) ...@@ -887,7 +895,6 @@ ParaMath.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
PRS.X += MathSettings.Get_LeftMargin(this.State); PRS.X += MathSettings.Get_LeftMargin(this.State);
PRS.XEnd -= MathSettings.Get_RightMargin(this.State); PRS.XEnd -= MathSettings.Get_RightMargin(this.State);
if(bFirstLine == false) if(bFirstLine == false)
PRS.X += MathSettings.Get_WrapIndent(this.State); PRS.X += MathSettings.Get_WrapIndent(this.State);
...@@ -943,12 +950,7 @@ ParaMath.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange) ...@@ -943,12 +950,7 @@ ParaMath.prototype.Recalculate_Range_Width = function(PRSC, _CurLine, _CurRange)
PRSC.Range.W += PRSC.SpaceLen - SpaceLen; PRSC.Range.W += PRSC.SpaceLen - SpaceLen;
PRSC.Range.SpaceLen = SpaceLen; PRSC.Range.SpaceLen = SpaceLen;
var W = PRSC.Range.W;
PRSC.Words++; PRSC.Words++;
var CurLine = _CurLine - this.Root.StartLine;
this.LinesWidths[CurLine] = W;
}; };
ParaMath.prototype.UpdateWidthLine = function(PRS, Width) ParaMath.prototype.UpdateWidthLine = function(PRS, Width)
{ {
...@@ -970,42 +972,12 @@ ParaMath.prototype.Recalculate_Range_Spaces = function(PRSA, _CurLine, _CurRange ...@@ -970,42 +972,12 @@ ParaMath.prototype.Recalculate_Range_Spaces = function(PRSA, _CurLine, _CurRange
var CurLine = _CurLine - this.Root.StartLine; var CurLine = _CurLine - this.Root.StartLine;
var CurRange = ( 0 === CurLine ? _CurRange - this.Root.StartRange : _CurRange ); var CurRange = ( 0 === CurLine ? _CurRange - this.Root.StartRange : _CurRange );
var Pos = new CMathPosition(); // до пересчета Bounds для текущей строки ранее должны быть вызваны Recalculate_Range_Width (для ширины), Recalculate_LineMetrics(для высоты и аскента)
Pos.x = PRSA.X;
Pos.y = PRSA.Y;
this.LinesPositions[CurLine] = Pos;
var pos = new CMathPosition(); var pos = new CMathPosition();
this.Root.setPosition(pos, _CurLine, _CurRange); this.Root.setPosition(pos, PRSA, _CurLine, _CurRange, _CurPage);
this.Root.Recalculate_Range_Spaces(PRSA, _CurLine, _CurRange, _CurPage); this.Root.Recalculate_Range_Spaces(PRSA, _CurLine, _CurRange, _CurPage);
/*
// Позиция в документе для формулы
//this.Math.absPos = {x: PRSA.X, y: PRSA.Y - this.Root.size.ascent};
this.X = PRSA.X;
this.Y = PRSA.Y - this.Root.size.ascent;
*/
/*var StartPos = this.protected_GetRangeStartPos(CurLine, CurRange);
var EndPos = this.protected_GetRangeEndPos(CurLine, CurRange);
if (EndPos >= 1)
{
if ( 0 !== PRSA.LettersSkip )
{
this.WidthVisible = this.Width;
PRSA.LettersSkip--;
}
else
this.WidthVisible = this.Width + PRSA.JustifyWord;
PRSA.X += this.WidthVisible;
PRSA.LastW = this.WidthVisible;
}*/
}; };
ParaMath.prototype.Recalculate_PageEndInfo = function(PRSI, _CurLine, _CurRange) ParaMath.prototype.Recalculate_PageEndInfo = function(PRSI, _CurLine, _CurRange)
{ {
...@@ -1530,14 +1502,22 @@ ParaMath.prototype.Draw_Elements = function(PDSE) ...@@ -1530,14 +1502,22 @@ ParaMath.prototype.Draw_Elements = function(PDSE)
this.Root.Draw_Elements(PDSE); this.Root.Draw_Elements(PDSE);
/*PDSE.Graphics.p_color(255,0,0, 255); /*PDSE.Graphics.p_color(255,0,0, 255);
PDSE.Graphics.drawHorLine(0, PDSE.Y - this.Ascent + this.Height, PDSE.X - 30, PDSE.X + this.Width + 30 , 1);*/ PDSE.Graphics.drawHorLine(0, PDSE.Y - this.Ascent + this.Height, PDSE.X - 30, PDSE.X + this.Width + 30 , 1);*/
}; };
ParaMath.prototype.GetLinePosition = function(Line) ParaMath.prototype.GetLinePosition = function(Line)
{ {
var CurLine = Line - this.Root.StartLine; /*var CurLine = Line - this.Root.StartLine;
return this.LinesPositions[CurLine];
var Bounds = this.Root.Get_Bounds();
Bounds.Get_LineBound(CurLine);
var Pos = new CMathPosition();
Pos.x = this.Bounds[CurLine].X;
Pos.y = this.Bounds[CurLine].Y + RootLineMetrics.ascent;*/
return this.Root.GetPos(Line);
}; };
ParaMath.prototype.Draw_Lines = function(PDSL) ParaMath.prototype.Draw_Lines = function(PDSL)
{ {
...@@ -1793,29 +1773,6 @@ ParaMath.prototype.Select_All = function(Direction) ...@@ -1793,29 +1773,6 @@ ParaMath.prototype.Select_All = function(Direction)
this.Root.Select_All(); this.Root.Select_All();
}; };
ParaMath.prototype.old_Selection_DrawRange = function(_CurLine, _CurRange, SelectionDraw)
{
var CurLine = _CurLine - this.StartLine;
var CurRange = ( 0 === CurLine ? _CurRange - this.StartRange : _CurRange );
var EndPos = this.protected_GetRangeEndPos(CurLine, CurRange);
if (EndPos >= 1)
{
if (true === this.bSelectionUse)
{
var oSelectedContent = this.GetSelectContent();
oSelectedContent.Content.Selection_DrawRange(_CurLine, _CurRange, SelectionDraw);
}
else
{
if ( true === SelectionDraw.FindStart )
{
SelectionDraw.StartX += this.Width;
}
}
}
};
ParaMath.prototype.Selection_DrawRange = function(_CurLine, _CurRange, SelectionDraw) ParaMath.prototype.Selection_DrawRange = function(_CurLine, _CurRange, SelectionDraw)
{ {
this.Root.Selection_DrawRange(_CurLine, _CurRange, SelectionDraw); this.Root.Selection_DrawRange(_CurLine, _CurRange, SelectionDraw);
...@@ -1919,10 +1876,11 @@ ParaMath.prototype.Get_ContentSelection = function() ...@@ -1919,10 +1876,11 @@ ParaMath.prototype.Get_ContentSelection = function()
if (oContent.bRoot) if (oContent.bRoot)
return null; return null;
var X = oContent.pos.x + this.X; var Bounds = oContent.Get_Bounds();
var Y = oContent.pos.y + this.Y;
var LinesCount = oContent.protected_GetLinesCount();
return {X : X, Y : Y, W : oContent.size.width, H : oContent.size.height}; return Bounds[LinesCount - 1];
}; };
ParaMath.prototype.Recalc_RunsCompiledPr = function() ParaMath.prototype.Recalc_RunsCompiledPr = function()
...@@ -2064,18 +2022,19 @@ ParaMath.prototype.Make_AutoCorrect = function() ...@@ -2064,18 +2022,19 @@ ParaMath.prototype.Make_AutoCorrect = function()
ParaMath.prototype.Get_Bounds = function() ParaMath.prototype.Get_Bounds = function()
{ {
if (undefined === this.Paragraph || null === this.Paragraph) if (undefined === this.Paragraph || null === this.Paragraph)
return {X : this.X, Y : this.Y, W : this.Width, H : this.Height, Page : 0}; return {X : 0, Y : 0, W : 0, H : 0, Page : 0};
else else
{ {
var LinesCount = this.Root.protected_GetLinesCount(); //var LinesCount = this.Root.protected_GetLinesCount();
var CurLine = this.Root.StartLine + LinesCount - 1;
/*if(LinesCount < this.Bounds.length)
this.Bounds.splice(LinesCount, this.Bounds.length - LinesCount);
var CurPage = this.Paragraph.Get_PageByLine(CurLine); return this.Bounds[LinesCount - 1];*/
var Y = this.Paragraph.Pages[CurPage].Y + this.Paragraph.Lines[CurLine].Top; var LinesCount = this.Root.protected_GetLinesCount();
var H = this.Paragraph.Lines[CurLine].Bottom - this.Paragraph.Lines[CurLine].Top;
return {X : this.X, Y : Y, W : this.Width, H : H, Page : this.Paragraph.Get_StartPage_Absolute() + CurPage}; return this.Root.Get_Bounds()[LinesCount - 1];
} }
}; };
......
...@@ -2172,7 +2172,7 @@ function CParagraphRecalculateStateWrap(Para) ...@@ -2172,7 +2172,7 @@ function CParagraphRecalculateStateWrap(Para)
this.bMath_OneLine = false; // for ParaMath this.bMath_OneLine = false; // for ParaMath
this.bMathWordLarge = false; // for ParaMath this.bMathWordLarge = false; // for ParaMath
this.PosEndRun = new CParagraphContentPos(); this.PosEndRun = new CParagraphContentPos();
this.ContentMetrics = new CMathMetrics(); this.ContentMetrics = new CMathBoundsMeasures();
} }
CParagraphRecalculateStateWrap.prototype = CParagraphRecalculateStateWrap.prototype =
......
...@@ -8356,7 +8356,7 @@ function CRunCollaborativeRange(PosS, PosE, Color) ...@@ -8356,7 +8356,7 @@ function CRunCollaborativeRange(PosS, PosE, Color)
this.PosE = PosE; this.PosE = PosE;
this.Color = Color; this.Color = Color;
} }
ParaRun.prototype.Math_SetPosition = function(pos, Line, Range) ParaRun.prototype.Math_SetPosition = function(pos, PRSA, Line, Range, Page)
{ {
var CurLine = Line - this.StartLine; var CurLine = Line - this.StartLine;
var CurRange = ( 0 === CurLine ? Range - this.StartRange : Range ); var CurRange = ( 0 === CurLine ? Range - this.StartRange : Range );
......
...@@ -37,7 +37,7 @@ CAccentCircumflex.prototype.calcSize = function(stretch) ...@@ -37,7 +37,7 @@ CAccentCircumflex.prototype.calcSize = function(stretch)
width *= augm; width *= augm;
return {width: width, height: height}; return {width: width, height: height};
} };
CAccentCircumflex.prototype.calcCoord = function(stretch) CAccentCircumflex.prototype.calcCoord = function(stretch)
{ {
var fontSize = this.Parent.Get_TxtPrControlLetter().FontSize; var fontSize = this.Parent.Get_TxtPrControlLetter().FontSize;
...@@ -102,7 +102,7 @@ CAccentCircumflex.prototype.calcCoord = function(stretch) ...@@ -102,7 +102,7 @@ CAccentCircumflex.prototype.calcCoord = function(stretch)
W = XX[3]; W = XX[3];
return {XX: XX, YY: YY, W: W, H: H}; return {XX: XX, YY: YY, W: W, H: H};
} };
CAccentCircumflex.prototype.drawPath = function(pGraphics, XX, YY) CAccentCircumflex.prototype.drawPath = function(pGraphics, XX, YY)
{ {
pGraphics._m(XX[0], YY[0]); pGraphics._m(XX[0], YY[0]);
...@@ -117,7 +117,7 @@ CAccentCircumflex.prototype.drawPath = function(pGraphics, XX, YY) ...@@ -117,7 +117,7 @@ CAccentCircumflex.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._l(XX[9], YY[9]); pGraphics._l(XX[9], YY[9]);
pGraphics._l(XX[10], YY[10]); pGraphics._l(XX[10], YY[10]);
pGraphics._l(XX[11], YY[11]); pGraphics._l(XX[11], YY[11]);
} };
function CAccentLine() function CAccentLine()
{ {
...@@ -134,7 +134,7 @@ CAccentLine.prototype.calcSize = function(stretch) ...@@ -134,7 +134,7 @@ CAccentLine.prototype.calcSize = function(stretch)
width = stretch > width ? stretch : width; width = stretch > width ? stretch : width;
return {width: width, height: height}; return {width: width, height: height};
} };
CAccentLine.prototype.draw = function(x, y, pGraphics) CAccentLine.prototype.draw = function(x, y, pGraphics)
{ {
var fontSize = this.Parent.Get_TxtPrControlLetter().FontSize; var fontSize = this.Parent.Get_TxtPrControlLetter().FontSize;
...@@ -145,7 +145,7 @@ CAccentLine.prototype.draw = function(x, y, pGraphics) ...@@ -145,7 +145,7 @@ CAccentLine.prototype.draw = function(x, y, pGraphics)
//pGraphics.p_color(0,0,0, 255); //pGraphics.p_color(0,0,0, 255);
pGraphics.drawHorLine(0, y, x1, x2, penW); pGraphics.drawHorLine(0, y, x1, x2, penW);
} };
function CAccentDoubleLine() function CAccentDoubleLine()
...@@ -174,7 +174,7 @@ CAccentDoubleLine.prototype.calcSize = function(stretch) ...@@ -174,7 +174,7 @@ CAccentDoubleLine.prototype.calcSize = function(stretch)
this.diff = DoubleLine.size.ascent - Line.size.ascent; this.diff = DoubleLine.size.ascent - Line.size.ascent;
return {width: width, height: height}; return {width: width, height: height};
} };
CAccentDoubleLine.prototype.draw = function(x, y, pGraphics) CAccentDoubleLine.prototype.draw = function(x, y, pGraphics)
{ {
var fontSize = this.Parent.Get_TxtPrControlLetter().FontSize; var fontSize = this.Parent.Get_TxtPrControlLetter().FontSize;
...@@ -194,7 +194,7 @@ CAccentDoubleLine.prototype.draw = function(x, y, pGraphics) ...@@ -194,7 +194,7 @@ CAccentDoubleLine.prototype.draw = function(x, y, pGraphics)
pGraphics.drawHorLine(0, y1, x1, x2, penW); pGraphics.drawHorLine(0, y1, x1, x2, penW);
pGraphics.drawHorLine(0, y2, x1, x2, penW); pGraphics.drawHorLine(0, y2, x1, x2, penW);
} };
function CAccentTilde() function CAccentTilde()
...@@ -219,7 +219,7 @@ CAccentTilde.prototype.calcSize = function(stretch) ...@@ -219,7 +219,7 @@ CAccentTilde.prototype.calcSize = function(stretch)
width *= augm; width *= augm;
return {width: width, height: height}; return {width: width, height: height};
} };
CAccentTilde.prototype.calcCoord = function(stretch) CAccentTilde.prototype.calcCoord = function(stretch)
{ {
var X = [], var X = [],
...@@ -276,7 +276,7 @@ CAccentTilde.prototype.calcCoord = function(stretch) ...@@ -276,7 +276,7 @@ CAccentTilde.prototype.calcCoord = function(stretch)
return {XX: XX, YY: YY, W: W, H: H}; return {XX: XX, YY: YY, W: W, H: H};
} };
CAccentTilde.prototype.drawPath = function(pGraphics, XX, YY) CAccentTilde.prototype.drawPath = function(pGraphics, XX, YY)
{ {
pGraphics._m(XX[0], YY[0]); pGraphics._m(XX[0], YY[0]);
...@@ -294,7 +294,7 @@ CAccentTilde.prototype.drawPath = function(pGraphics, XX, YY) ...@@ -294,7 +294,7 @@ CAccentTilde.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._c(XX[21], YY[21], XX[22], YY[22], XX[23], YY[23] ); pGraphics._c(XX[21], YY[21], XX[22], YY[22], XX[23], YY[23] );
pGraphics._c(XX[23], YY[23], XX[24], YY[24], XX[25], YY[25] ); pGraphics._c(XX[23], YY[23], XX[24], YY[24], XX[25], YY[25] );
pGraphics._l(XX[26], YY[26]); pGraphics._l(XX[26], YY[26]);
} };
function CAccentBreve() function CAccentBreve()
...@@ -310,7 +310,7 @@ CAccentBreve.prototype.calcSize = function(stretch) ...@@ -310,7 +310,7 @@ CAccentBreve.prototype.calcSize = function(stretch)
var height = 2.469444444444445*betta; var height = 2.469444444444445*betta;
return {width: width, height: height}; return {width: width, height: height};
} };
CAccentBreve.prototype.calcCoord = function(stretch) CAccentBreve.prototype.calcCoord = function(stretch)
{ {
var X = [], var X = [],
...@@ -358,7 +358,7 @@ CAccentBreve.prototype.calcCoord = function(stretch) ...@@ -358,7 +358,7 @@ CAccentBreve.prototype.calcCoord = function(stretch)
W = XX[0]; W = XX[0];
return {XX: XX, YY: YY, W: W, H: H}; return {XX: XX, YY: YY, W: W, H: H};
} };
CAccentBreve.prototype.drawPath = function(pGraphics, XX, YY) CAccentBreve.prototype.drawPath = function(pGraphics, XX, YY)
{ {
pGraphics._m(XX[0], YY[0]); pGraphics._m(XX[0], YY[0]);
...@@ -374,7 +374,7 @@ CAccentBreve.prototype.drawPath = function(pGraphics, XX, YY) ...@@ -374,7 +374,7 @@ CAccentBreve.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._c(XX[17], YY[17], XX[18], YY[18], XX[19], YY[19] ); pGraphics._c(XX[17], YY[17], XX[18], YY[18], XX[19], YY[19] );
pGraphics._c(XX[19], YY[19], XX[20], YY[20], XX[21], YY[21] ); pGraphics._c(XX[19], YY[19], XX[20], YY[20], XX[21], YY[21] );
pGraphics._l(XX[22], YY[22]); pGraphics._l(XX[22], YY[22]);
} };
function CMathAccentPr() function CMathAccentPr()
{ {
...@@ -453,7 +453,7 @@ CAccent.prototype.init = function(props) ...@@ -453,7 +453,7 @@ CAccent.prototype.init = function(props)
this.setProperties(props); this.setProperties(props);
this.fillContent(); this.fillContent();
} };
CAccent.prototype.getBase = function() CAccent.prototype.getBase = function()
{ {
return this.Content[0]; return this.Content[0];
...@@ -467,7 +467,7 @@ CAccent.prototype.IsAccent = function() ...@@ -467,7 +467,7 @@ CAccent.prototype.IsAccent = function()
{ {
return true; return true;
}; };
CAccent.prototype.setPosition = function(pos, Line, Range) CAccent.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
{ {
this.pos.x = pos.x; this.pos.x = pos.x;
this.pos.y = pos.y - this.size.ascent; this.pos.y = pos.y - this.size.ascent;
...@@ -490,7 +490,7 @@ CAccent.prototype.setPosition = function(pos, Line, Range) ...@@ -490,7 +490,7 @@ CAccent.prototype.setPosition = function(pos, Line, Range)
PosBase.x = this.pos.x + this.GapLeft + alignCnt; PosBase.x = this.pos.x + this.GapLeft + alignCnt;
PosBase.y = this.pos.y + this.operator.size.height + oBase.size.ascent; PosBase.y = this.pos.y + this.operator.size.height + oBase.size.ascent;
oBase.setPosition(PosBase, Line, Range); oBase.setPosition(PosBase, PRSA, Line, Range, Page);
pos.x += this.size.width; pos.x += this.size.width;
}; };
...@@ -532,7 +532,9 @@ CAccent.prototype.Resize = function(oMeasure, RPI) ...@@ -532,7 +532,9 @@ CAccent.prototype.Resize = function(oMeasure, RPI)
width += this.GapLeft + this.GapRight; width += this.GapLeft + this.GapRight;
this.size = {height: height, width: width, ascent: ascent}; this.size.height = height;
this.size.width = width;
this.size.ascent = ascent;
}; };
CAccent.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) CAccent.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
{ {
......
This diff is collapsed.
...@@ -11,14 +11,14 @@ CMathBreak.prototype.Set_FromObject = function(Obj) ...@@ -11,14 +11,14 @@ CMathBreak.prototype.Set_FromObject = function(Obj)
if(Obj.AlnAt >= 1 && Obj.AlnAt <= 255) if(Obj.AlnAt >= 1 && Obj.AlnAt <= 255)
this.AlnAt = Obj.AlnAt; this.AlnAt = Obj.AlnAt;
} }
} };
CMathBreak.prototype.Copy = function() CMathBreak.prototype.Copy = function()
{ {
var NewMBreak = new CMathBreak(); var NewMBreak = new CMathBreak();
NewMBreak.AlnAt = this.AlnAt; NewMBreak.AlnAt = this.AlnAt;
return NewMBreak; return NewMBreak;
} };
CMathBreak.prototype.Write_ToBinary = function(Writer) CMathBreak.prototype.Write_ToBinary = function(Writer)
{ {
if(this.AlnAt !== undefined) if(this.AlnAt !== undefined)
...@@ -30,7 +30,7 @@ CMathBreak.prototype.Write_ToBinary = function(Writer) ...@@ -30,7 +30,7 @@ CMathBreak.prototype.Write_ToBinary = function(Writer)
{ {
Writer.WriteBool(true); Writer.WriteBool(true);
} }
} };
CMathBreak.prototype.Read_FromBinary = function(Reader) CMathBreak.prototype.Read_FromBinary = function(Reader)
{ {
if(Reader.GetBool() == false) if(Reader.GetBool() == false)
...@@ -41,7 +41,7 @@ CMathBreak.prototype.Read_FromBinary = function(Reader) ...@@ -41,7 +41,7 @@ CMathBreak.prototype.Read_FromBinary = function(Reader)
{ {
this.AlnAt = undefined; this.AlnAt = undefined;
} }
} };
function CMathBorderBoxPr() function CMathBorderBoxPr()
{ {
...@@ -164,7 +164,7 @@ CBorderBox.prototype.init = function(props) ...@@ -164,7 +164,7 @@ CBorderBox.prototype.init = function(props)
this.setProperties(props); this.setProperties(props);
this.fillContent(); this.fillContent();
} };
CBorderBox.prototype.getBase = function() CBorderBox.prototype.getBase = function()
{ {
return this.Content[0]; return this.Content[0];
...@@ -173,7 +173,7 @@ CBorderBox.prototype.fillContent = function() ...@@ -173,7 +173,7 @@ CBorderBox.prototype.fillContent = function()
{ {
this.setDimension(1, 1); this.setDimension(1, 1);
this.elements[0][0] = this.getBase(); this.elements[0][0] = this.getBase();
} };
CBorderBox.prototype.recalculateSize = function() CBorderBox.prototype.recalculateSize = function()
{ {
var base = this.elements[0][0].size; var base = this.elements[0][0].size;
...@@ -199,8 +199,10 @@ CBorderBox.prototype.recalculateSize = function() ...@@ -199,8 +199,10 @@ CBorderBox.prototype.recalculateSize = function()
width += this.GapLeft + this.GapRight; width += this.GapLeft + this.GapRight;
this.size = {width : width, height: height, ascent: ascent}; this.size.width = width;
} this.size.height = height;
this.size.ascent = ascent;
};
CBorderBox.prototype.Draw_Elements = function(PDSE) CBorderBox.prototype.Draw_Elements = function(PDSE)
{ {
var _X = PDSE.X; var _X = PDSE.X;
...@@ -358,8 +360,8 @@ CBorderBox.prototype.Draw_Elements = function(PDSE) ...@@ -358,8 +360,8 @@ CBorderBox.prototype.Draw_Elements = function(PDSE)
PDSE.X = _X + this.size.width; PDSE.X = _X + this.size.width;
} };
CBorderBox.prototype.setPosition = function(pos, Line, Range) CBorderBox.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
{ {
this.pos.x = pos.x; this.pos.x = pos.x;
this.pos.y = pos.y - this.size.ascent; this.pos.y = pos.y - this.size.ascent;
...@@ -379,10 +381,10 @@ CBorderBox.prototype.setPosition = function(pos, Line, Range) ...@@ -379,10 +381,10 @@ CBorderBox.prototype.setPosition = function(pos, Line, Range)
else else
NewPos.y = this.pos.y + Base.size.ascent; NewPos.y = this.pos.y + Base.size.ascent;
Base.setPosition(NewPos, Line, Range); // base Base.setPosition(NewPos, PRSA, Line, Range, Page); // base
pos.x += this.size.width; pos.x += this.size.width;
} };
function CMathBoxPr() function CMathBoxPr()
{ {
...@@ -581,7 +583,7 @@ CBar.prototype.init = function(props) ...@@ -581,7 +583,7 @@ CBar.prototype.init = function(props)
this.setProperties(props); this.setProperties(props);
this.fillContent(); this.fillContent();
} };
CBar.prototype.getBase = function() CBar.prototype.getBase = function()
{ {
return this.Content[0]; return this.Content[0];
...@@ -590,7 +592,7 @@ CBar.prototype.fillContent = function() ...@@ -590,7 +592,7 @@ 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.ApplyProperties = function(RPI) CBar.prototype.ApplyProperties = function(RPI)
{ {
if(this.RecalcInfo.bProps == true) if(this.RecalcInfo.bProps == true)
...@@ -602,14 +604,14 @@ CBar.prototype.ApplyProperties = function(RPI) ...@@ -602,14 +604,14 @@ CBar.prototype.ApplyProperties = function(RPI)
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) CBar.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo)
{ {
this.ApplyProperties(RPI); this.ApplyProperties(RPI);
this.operator.PreRecalc(this, ParaMath); this.operator.PreRecalc(this, ParaMath);
CBar.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSize, RPI, GapsInfo); CBar.superclass.PreRecalc.call(this, Parent, ParaMath, ArgSize, RPI, GapsInfo);
} };
CBar.prototype.getAscent = function() CBar.prototype.getAscent = function()
{ {
var ascent; var ascent;
...@@ -620,7 +622,7 @@ CBar.prototype.getAscent = function() ...@@ -620,7 +622,7 @@ CBar.prototype.getAscent = function()
ascent = this.elements[0][0].size.ascent; ascent = this.elements[0][0].size.ascent;
return ascent; return ascent;
} };
function CMathPhantomPr() function CMathPhantomPr()
{ {
...@@ -726,13 +728,13 @@ CPhantom.prototype.init = function(props) ...@@ -726,13 +728,13 @@ CPhantom.prototype.init = function(props)
this.setProperties(props); this.setProperties(props);
this.fillContent(); this.fillContent();
} };
CPhantom.prototype.getBase = function() CPhantom.prototype.getBase = function()
{ {
return this.Content[0]; return this.Content[0];
} };
CPhantom.prototype.fillContent = function() CPhantom.prototype.fillContent = function()
{ {
this.setDimension(1, 1); this.setDimension(1, 1);
this.elements[0][0] = this.getBase(); this.elements[0][0] = this.getBase();
} };
\ No newline at end of file \ No newline at end of file
...@@ -97,6 +97,29 @@ CDegreeBase.prototype.Resize = function(oMeasure, RPI) ...@@ -97,6 +97,29 @@ CDegreeBase.prototype.Resize = function(oMeasure, RPI)
else if(this.Pr.type === DEGREE_SUBSCRIPT) else if(this.Pr.type === DEGREE_SUBSCRIPT)
this.recalculateSubScript(oMeasure); this.recalculateSubScript(oMeasure);
}; };
/*CDegreeBase.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
{
if(PRS.bMath_OneLine == false)
{
var CurLine = PRS.Line - this.StartLine;
var CurRange = ( 0 === CurLine ? PRS.Range - this.StartRange : PRS.Range );
var RangeStartPos = this.protected_AddRange(CurLine, CurRange);
var RangeEndPos = 0;
this.baseContent.Recalculate_Range(PRS, ParaPr, Depth + 1);
if(PRS.NewRange == false)
{
RangeEndPos = 1;
this.iterContent.Recalculate_Range(PRS, ParaPr, Depth + 1);
}
}
else
{
CDegreeBase.superclass.Recalculate_Range.call(this, PRS, ParaPr, Depth);
}
};*/
CDegreeBase.prototype.recalculateSize = function(oMeasure) CDegreeBase.prototype.recalculateSize = function(oMeasure)
{ {
if(this.Pr.type === DEGREE_SUPERSCRIPT) if(this.Pr.type === DEGREE_SUPERSCRIPT)
...@@ -104,6 +127,86 @@ CDegreeBase.prototype.recalculateSize = function(oMeasure) ...@@ -104,6 +127,86 @@ CDegreeBase.prototype.recalculateSize = function(oMeasure)
else if(this.Pr.type === DEGREE_SUBSCRIPT) else if(this.Pr.type === DEGREE_SUBSCRIPT)
this.recalculateSubScript(oMeasure); this.recalculateSubScript(oMeasure);
}; };
CDegreeBase.prototype.new_recalculateSup = function(oMeasure, PRS)
{
var mgCtrPrp = this.Get_TxtPrControlLetter();
var iterSize = this.iterContent.size;
var base = this.baseContent.size,
iter = this.iterContent.size;
this.upBase = 0;
this.upIter = 0;
var HeightLine = AscentLine + DescentLine;
// для итератора степени выравниваем по последнему текстовому элементу (в случае если размер шрифта для основания один и то же)
// исключая случай, когда итератор в N-арном операторе
var BaseJustDraw = this.baseContent.IsJustDraw();
var lastElem = this.baseContent.GetLastElement();
var BaseRun = lastElem.Type == para_Math_Run && mgCtrPrp.FontSize == lastElem.Get_CompiledPr(false).FontSize;
var bTextElement = BaseJustDraw && (BaseRun || (lastElem.Type !== para_Math_Run && lastElem.IsJustDraw()));
var UpBaseline = 0.5*TextAscent;
if(bTextElement)
{
var minR = 0.3*TextAscent;
var last = lastElem.size,
upBaseLast = 0,
upBaseIter = 0;
if(base.ascent > UpBaseline + iter.ascent && iter.height + minR < base.ascent) // размер шрифта итератора << размера шрифта основания => iter << base; дробь + текст
{
this.upIter = base.ascent - (UpBaseline + iter.ascent);
}
else if(UpBaseline - (iter.height - iter.ascent) > minR)
{
this.upBase = UpBaseline + iter.ascent - base.ascent;
}
else
{
this.upBase = iter.height + minR - base.ascent;
}
}
else
{
var shCenter = this.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp);
if(iter.height - iter.ascent + shCenter > base.ascent) // для дробей и т.п.
{
this.upBase = iter.height - (base.ascent - shCenter);
}
else if(iter.ascent > shCenter)
{
this.upBase = iter.ascent - shCenter;
}
else
{
this.upIter = shCenter - iter.ascent;
}
}
if( this.bNaryInline)
this.dW = 0.17*PlH;
else
this.dW = 0.056*PlH;
if(PRS.bMath_OneLine == true)
{
this.size.height = this.upBase + base.height;
this.size.ascent = this.upBase + base.ascent;
this.size.width = base.width + iter.width + this.dW;
this.size.width += this.GapLeft + this.GapRight;
}
};
CDegreeBase.prototype.recalculateSup = function(oMeasure) CDegreeBase.prototype.recalculateSup = function(oMeasure)
{ {
var base = this.baseContent.size, var base = this.baseContent.size,
...@@ -182,7 +285,9 @@ CDegreeBase.prototype.recalculateSup = function(oMeasure) ...@@ -182,7 +285,9 @@ CDegreeBase.prototype.recalculateSup = function(oMeasure)
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;
this.size = {width: width, height: height, ascent: ascent}; this.size.height = height;
this.size.width = width;
this.size.ascent = ascent;
}; };
CDegreeBase.prototype.recalculateSubScript = function(oMeasure) CDegreeBase.prototype.recalculateSubScript = function(oMeasure)
{ {
...@@ -260,9 +365,11 @@ CDegreeBase.prototype.recalculateSubScript = function(oMeasure) ...@@ -260,9 +365,11 @@ CDegreeBase.prototype.recalculateSubScript = function(oMeasure)
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;
this.size = {width: width, height: height, ascent: ascent}; this.size.height = height;
this.size.width = width;
this.size.ascent = ascent;
}; };
CDegreeBase.prototype.setPosition = function(pos, Line, Range) CDegreeBase.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
{ {
this.pos.x = pos.x; this.pos.x = pos.x;
...@@ -287,8 +394,8 @@ CDegreeBase.prototype.setPosition = function(pos, Line, Range) ...@@ -287,8 +394,8 @@ CDegreeBase.prototype.setPosition = function(pos, Line, Range)
PosIter.x = this.pos.x + this.GapLeft + oBase.size.width + this.dW; PosIter.x = this.pos.x + this.GapLeft + oBase.size.width + this.dW;
PosIter.y = this.pos.y + this.upIter + oIter.size.ascent; PosIter.y = this.pos.y + this.upIter + oIter.size.ascent;
oBase.setPosition(PosBase, Line, Range); oBase.setPosition(PosBase, PRSA, Line, Range, Page);
oIter.setPosition(PosIter, Line, Range); oIter.setPosition(PosIter, PRSA, Line, Range, Page);
pos.x += this.size.width; pos.x += this.size.width;
}; };
...@@ -632,7 +739,9 @@ CDegreeSubSupBase.prototype.recalculateSize = function(oMeasure, RPI) ...@@ -632,7 +739,9 @@ CDegreeSubSupBase.prototype.recalculateSize = function(oMeasure, RPI)
width = this.iters.size.width + base.width + this.dW; width = this.iters.size.width + base.width + this.dW;
width += this.GapLeft + this.GapRight; width += this.GapLeft + this.GapRight;
this.size = {width: width, height: height, ascent: ascent}; this.size.height = height;
this.size.width = width;
this.size.ascent = ascent;
} }
CDegreeSubSupBase.prototype.getBase = function() CDegreeSubSupBase.prototype.getBase = function()
......
...@@ -55,11 +55,11 @@ CFraction.prototype.init = function(props) ...@@ -55,11 +55,11 @@ CFraction.prototype.init = function(props)
this.setProperties(props); this.setProperties(props);
this.fillContent(); this.fillContent();
} };
CFraction.prototype.getType = function() CFraction.prototype.getType = function()
{ {
return this.Pr.type; return this.Pr.type;
} };
CFraction.prototype.draw = function(x, y, pGraphics, PDSE) CFraction.prototype.draw = function(x, y, pGraphics, PDSE)
{ {
if(this.Pr.type == BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION) if(this.Pr.type == BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION)
...@@ -68,7 +68,7 @@ CFraction.prototype.draw = function(x, y, pGraphics, PDSE) ...@@ -68,7 +68,7 @@ CFraction.prototype.draw = function(x, y, pGraphics, PDSE)
this.drawSkewedFraction(x, y, pGraphics, PDSE); this.drawSkewedFraction(x, y, pGraphics, PDSE);
else if(this.Pr.type == LINEAR_FRACTION) else if(this.Pr.type == LINEAR_FRACTION)
this.drawLinearFraction(x, y, pGraphics, PDSE); this.drawLinearFraction(x, y, pGraphics, PDSE);
} };
CFraction.prototype.Draw_Elements = function(PDSE) CFraction.prototype.Draw_Elements = function(PDSE)
{ {
var X = PDSE.X; var X = PDSE.X;
...@@ -81,7 +81,7 @@ CFraction.prototype.Draw_Elements = function(PDSE) ...@@ -81,7 +81,7 @@ CFraction.prototype.Draw_Elements = function(PDSE)
this.drawLinearFraction(PDSE); this.drawLinearFraction(PDSE);
PDSE.X = X + this.size.width; PDSE.X = X + this.size.width;
} };
CFraction.prototype.drawBarFraction = function(PDSE) CFraction.prototype.drawBarFraction = function(PDSE)
{ {
var mgCtrPrp = this.Get_TxtPrControlLetter(); var mgCtrPrp = this.Get_TxtPrControlLetter();
...@@ -107,7 +107,7 @@ CFraction.prototype.drawBarFraction = function(PDSE) ...@@ -107,7 +107,7 @@ CFraction.prototype.drawBarFraction = function(PDSE)
} }
CFraction.superclass.Draw_Elements.call(this, PDSE); CFraction.superclass.Draw_Elements.call(this, PDSE);
} };
CFraction.prototype.drawSkewedFraction = function(PDSE) CFraction.prototype.drawSkewedFraction = function(PDSE)
{ {
var mgCtrPrp = this.Get_TxtPrControlLetter(); var mgCtrPrp = this.Get_TxtPrControlLetter();
...@@ -203,7 +203,7 @@ CFraction.prototype.drawSkewedFraction = function(PDSE) ...@@ -203,7 +203,7 @@ CFraction.prototype.drawSkewedFraction = function(PDSE)
PDSE.Graphics.ds(); PDSE.Graphics.ds();
CFraction.superclass.Draw_Elements.call(this, PDSE); CFraction.superclass.Draw_Elements.call(this, PDSE);
} };
CFraction.prototype.drawLinearFraction = function(PDSE) CFraction.prototype.drawLinearFraction = function(PDSE)
{ {
var shift = 0.1*this.dW; var shift = 0.1*this.dW;
...@@ -232,7 +232,7 @@ CFraction.prototype.drawLinearFraction = function(PDSE) ...@@ -232,7 +232,7 @@ CFraction.prototype.drawLinearFraction = function(PDSE)
PDSE.Graphics.ds(); PDSE.Graphics.ds();
CFraction.superclass.Draw_Elements.call(this, PDSE); CFraction.superclass.Draw_Elements.call(this, PDSE);
} };
CFraction.prototype.getNumerator = function() CFraction.prototype.getNumerator = function()
{ {
var numerator; var numerator;
...@@ -243,7 +243,7 @@ CFraction.prototype.getNumerator = function() ...@@ -243,7 +243,7 @@ CFraction.prototype.getNumerator = function()
numerator = this.elements[0][0]; numerator = this.elements[0][0];
return numerator; return numerator;
} };
CFraction.prototype.getDenominator = function() CFraction.prototype.getDenominator = function()
{ {
var denominator; var denominator;
...@@ -254,7 +254,7 @@ CFraction.prototype.getDenominator = function() ...@@ -254,7 +254,7 @@ CFraction.prototype.getDenominator = function()
denominator = this.elements[0][1]; denominator = this.elements[0][1];
return denominator; return denominator;
} };
CFraction.prototype.getNumeratorMathContent = function() CFraction.prototype.getNumeratorMathContent = function()
{ {
return this.Content[0]; return this.Content[0];
...@@ -302,7 +302,7 @@ CFraction.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInf ...@@ -302,7 +302,7 @@ CFraction.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInf
this.Numerator.PreRecalc(this, ParaMath, ArgSzNumDen, NewRPI); this.Numerator.PreRecalc(this, ParaMath, ArgSzNumDen, NewRPI);
this.Denominator.PreRecalc(this, ParaMath, ArgSzNumDen, NewRPI); this.Denominator.PreRecalc(this, ParaMath, ArgSzNumDen, NewRPI);
} };
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)
...@@ -311,7 +311,7 @@ CFraction.prototype.recalculateSize = function(oMeasure) ...@@ -311,7 +311,7 @@ CFraction.prototype.recalculateSize = function(oMeasure)
this.recalculateSkewed(oMeasure); this.recalculateSkewed(oMeasure);
else if(this.Pr.type == LINEAR_FRACTION) else if(this.Pr.type == LINEAR_FRACTION)
this.recalculateLinear(oMeasure); this.recalculateLinear(oMeasure);
} };
CFraction.prototype.recalculateBarFraction = function(oMeasure) CFraction.prototype.recalculateBarFraction = function(oMeasure)
{ {
var num = this.elements[0][0].size, var num = this.elements[0][0].size,
...@@ -325,8 +325,10 @@ CFraction.prototype.recalculateBarFraction = function(oMeasure) ...@@ -325,8 +325,10 @@ CFraction.prototype.recalculateBarFraction = function(oMeasure)
width += this.GapLeft + this.GapRight; width += this.GapLeft + this.GapRight;
this.size = {width: width, height: height, ascent: ascent}; this.size.height = height;
} this.size.width = width;
this.size.ascent = ascent;
};
CFraction.prototype.recalculateSkewed = function(oMeasure) CFraction.prototype.recalculateSkewed = function(oMeasure)
{ {
var mgCtrPrp = this.Get_TxtPrControlLetter(); var mgCtrPrp = this.Get_TxtPrControlLetter();
...@@ -339,8 +341,10 @@ CFraction.prototype.recalculateSkewed = function(oMeasure) ...@@ -339,8 +341,10 @@ CFraction.prototype.recalculateSkewed = function(oMeasure)
width += this.GapLeft + this.GapRight; width += this.GapLeft + this.GapRight;
this.size = {width: width, height: height, ascent: ascent}; this.size.height = height;
} this.size.width = width;
this.size.ascent = ascent;
};
CFraction.prototype.recalculateLinear = function() CFraction.prototype.recalculateLinear = function()
{ {
var AscentFirst = this.elements[0][0].size.ascent, var AscentFirst = this.elements[0][0].size.ascent,
...@@ -376,9 +380,11 @@ CFraction.prototype.recalculateLinear = function() ...@@ -376,9 +380,11 @@ CFraction.prototype.recalculateLinear = function()
width += this.GapLeft + this.GapRight; width += this.GapLeft + this.GapRight;
this.size = {height: height, width: width, ascent: ascent}; this.size.height = height;
} this.size.width = width;
CFraction.prototype.setPosition = function(pos, Line, Range) this.size.ascent = ascent;
};
CFraction.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
{ {
if(this.Pr.type == SKEWED_FRACTION) if(this.Pr.type == SKEWED_FRACTION)
{ {
...@@ -401,14 +407,14 @@ CFraction.prototype.setPosition = function(pos, Line, Range) ...@@ -401,14 +407,14 @@ CFraction.prototype.setPosition = function(pos, Line, Range)
PosDen.x = X + Numerator.size.width + this.dW; PosDen.x = X + Numerator.size.width + this.dW;
PosDen.y = Y + Numerator.size.height + Denominator.size.ascent; PosDen.y = Y + Numerator.size.height + Denominator.size.ascent;
Numerator.setPosition(PosNum, Line, Range); Numerator.setPosition(PosNum, PRSA, Line, Range, Page);
Denominator.setPosition(PosDen, Line, Range); Denominator.setPosition(PosDen, PRSA, Line, Range, Page);
pos.x += this.size.width; pos.x += this.size.width;
} }
else else
CFraction.superclass.setPosition.call(this, pos, Line, Range); CFraction.superclass.setPosition.call(this, pos, PRSA, Line, Range, Page);
} };
CFraction.prototype.fillContent = function() CFraction.prototype.fillContent = function()
{ {
this.Numerator = new CNumerator(this.Content[0]); this.Numerator = new CNumerator(this.Content[0]);
...@@ -436,7 +442,7 @@ CFraction.prototype.fillContent = function() ...@@ -436,7 +442,7 @@ CFraction.prototype.fillContent = function()
this.elements[0][0] = this.Numerator.getElement(); this.elements[0][0] = this.Numerator.getElement();
this.elements[0][1] = this.Denominator.getElement(); this.elements[0][1] = this.Denominator.getElement();
} }
} };
CFraction.prototype.Document_UpdateInterfaceState = function(MathProps) CFraction.prototype.Document_UpdateInterfaceState = function(MathProps)
{ {
MathProps.Type = c_oAscMathInterfaceType.Fraction; MathProps.Type = c_oAscMathInterfaceType.Fraction;
...@@ -454,11 +460,11 @@ CFractionBase.prototype.init = function(MathContent) ...@@ -454,11 +460,11 @@ 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.getElement = function() CFractionBase.prototype.getElement = function()
{ {
return this.elements[0][0]; return this.elements[0][0];
} };
CFractionBase.prototype.setElement = function(Element) CFractionBase.prototype.setElement = function(Element)
{ {
this.elements[0][0] = Element; this.elements[0][0] = Element;
...@@ -466,7 +472,7 @@ CFractionBase.prototype.setElement = function(Element) ...@@ -466,7 +472,7 @@ CFractionBase.prototype.setElement = function(Element)
CFractionBase.prototype.getPropsForWrite = function() CFractionBase.prototype.getPropsForWrite = function()
{ {
return {}; return {};
} };
CFractionBase.prototype.Get_Id = function() CFractionBase.prototype.Get_Id = function()
{ {
return this.elements[0][0].Get_Id(); return this.elements[0][0].Get_Id();
...@@ -517,8 +523,10 @@ CNumerator.prototype.recalculateSize = function() ...@@ -517,8 +523,10 @@ CNumerator.prototype.recalculateSize = function()
var height = arg.height + this.gap; var height = arg.height + this.gap;
var ascent = arg.ascent; var ascent = arg.ascent;
this.size = {width : width, height: height, ascent: ascent}; this.size.height = height;
} this.size.width = width;
this.size.ascent = ascent;
};
function CDenominator(MathContent) function CDenominator(MathContent)
{ {
...@@ -557,12 +565,14 @@ CDenominator.prototype.recalculateSize = function() ...@@ -557,12 +565,14 @@ CDenominator.prototype.recalculateSize = function()
var height = arg.height + this.gap; var height = arg.height + this.gap;
var ascent = arg.ascent + this.gap; var ascent = arg.ascent + this.gap;
this.size = {width : width, height: height, ascent: ascent}; this.size.height = height;
} this.size.width = width;
CDenominator.prototype.setPosition = function(pos, Line, Range) this.size.ascent = ascent;
};
CDenominator.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
{ {
pos.y += this.gap; pos.y += this.gap;
CDenominator.superclass.setPosition.call(this, pos, Line, Range); CDenominator.superclass.setPosition.call(this, pos, PRSA, Line, Range, Page);
} };
////////// //////////
...@@ -114,7 +114,9 @@ CLimitPrimary.prototype.recalculateSize = function(oMeasure) ...@@ -114,7 +114,9 @@ CLimitPrimary.prototype.recalculateSize = function(oMeasure)
width += this.GapLeft + this.GapRight; width += this.GapLeft + this.GapRight;
this.size = {width: width, height: height, ascent: ascent}; this.size.height = height;
this.size.width = width;
this.size.ascent = ascent;
}; };
function CLimit(props) function CLimit(props)
......
This diff is collapsed.
...@@ -19,6 +19,7 @@ var StartTextElement = 0x2B1A; // Cambria Math ...@@ -19,6 +19,7 @@ var StartTextElement = 0x2B1A; // Cambria Math
function CMathSize() function CMathSize()
{ {
this.Type = MATH_SIZE;
this.width = 0; this.width = 0;
this.height = 0; this.height = 0;
this.ascent = 0; this.ascent = 0;
...@@ -885,7 +886,7 @@ CMathText.prototype = ...@@ -885,7 +886,7 @@ CMathText.prototype =
this.value = Reader.GetLong(); this.value = Reader.GetLong();
} }
} };
function CMathAmp() function CMathAmp()
{ {
...@@ -1023,7 +1024,7 @@ CMathAmp.prototype = ...@@ -1023,7 +1024,7 @@ CMathAmp.prototype =
{ {
} }
} };
var MathFont_ForMathText = 1; var MathFont_ForMathText = 1;
var MathFont_ForSpecialOperator = 2; var MathFont_ForSpecialOperator = 2;
......
...@@ -208,3 +208,6 @@ var ALIGN_EMPTY = 3; ...@@ -208,3 +208,6 @@ var ALIGN_EMPTY = 3;
var MATH_LEFT_MARGIN = 0; var MATH_LEFT_MARGIN = 0;
var MATH_RIGHT_MARGIN = 1; var MATH_RIGHT_MARGIN = 1;
var MATH_WRAP_INDENT = 2; var MATH_WRAP_INDENT = 2;
var MATH_SIZE = 0;
var MATH_BOUNDS_MEASURES = 1;
\ No newline at end of file
...@@ -314,8 +314,10 @@ CMatrixBase.prototype.recalculateSize = function(oMeasure, RPI) ...@@ -314,8 +314,10 @@ CMatrixBase.prototype.recalculateSize = function(oMeasure, RPI)
width += this.GapLeft + this.GapRight; width += this.GapLeft + this.GapRight;
this.size = {width: width, height: height, ascent: ascent}; this.size.height = height;
} this.size.width = width;
this.size.ascent = ascent;
};
CMatrixBase.prototype.baseJustification = function(type) CMatrixBase.prototype.baseJustification = function(type)
{ {
this.Pr.baseJc = type; this.Pr.baseJc = type;
...@@ -342,7 +344,7 @@ CMatrixBase.prototype.setDefaultSpace = function() ...@@ -342,7 +344,7 @@ CMatrixBase.prototype.setDefaultSpace = function()
row: [], row: [],
column: [] column: []
}; };
} };
CMatrixBase.prototype.setRuleGap = function(oSpace, rule, gap, minGap) CMatrixBase.prototype.setRuleGap = function(oSpace, rule, gap, minGap)
{ {
var bInt = rule == rule - 0 && rule == rule^0, var bInt = rule == rule - 0 && rule == rule^0,
...@@ -461,8 +463,8 @@ CMathMatrix.prototype.init = function(props) ...@@ -461,8 +463,8 @@ CMathMatrix.prototype.init = function(props)
this.Fill_LogicalContent(nRowsCount * nColsCount); this.Fill_LogicalContent(nRowsCount * nColsCount);
this.fillContent(); this.fillContent();
} };
CMathMatrix.prototype.setPosition = function(pos, Line, Range) CMathMatrix.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
{ {
this.pos.x = pos.x; this.pos.x = pos.x;
...@@ -489,14 +491,14 @@ CMathMatrix.prototype.setPosition = function(pos, Line, Range) ...@@ -489,14 +491,14 @@ CMathMatrix.prototype.setPosition = function(pos, Line, Range)
NewPos.x = this.pos.x + this.GapLeft + al.x + w; NewPos.x = this.pos.x + this.GapLeft + al.x + w;
NewPos.y = this.pos.y + al.y + h + Item.size.ascent; NewPos.y = this.pos.y + al.y + h + Item.size.ascent;
Item.setPosition(NewPos, Line, Range); Item.setPosition(NewPos, PRSA, Line, Range, Page);
w += Widths[j] + this.gaps.column[j]; w += Widths[j] + this.gaps.column[j];
} }
h += Heights[i] + this.gaps.row[i]; h += Heights[i] + this.gaps.row[i];
} }
pos.x += this.size.width; pos.x += this.size.width;
} };
CMathMatrix.prototype.getMetrics = function(RPI) CMathMatrix.prototype.getMetrics = function(RPI)
{ {
var Ascents = []; var Ascents = [];
...@@ -692,7 +694,7 @@ CEqArray.prototype.init = function(props) ...@@ -692,7 +694,7 @@ CEqArray.prototype.init = function(props)
this.setProperties(props); this.setProperties(props);
this.fillContent(); this.fillContent();
} };
CEqArray.prototype.addRow = function() CEqArray.prototype.addRow = function()
{ {
var NewContent = new CMathContent(); var NewContent = new CMathContent();
...@@ -704,7 +706,7 @@ CEqArray.prototype.addRow = function() ...@@ -704,7 +706,7 @@ CEqArray.prototype.addRow = function()
this.setPr(NewPr); this.setPr(NewPr);
return NewContent; return NewContent;
} };
CEqArray.prototype.setPr = function(NewPr) CEqArray.prototype.setPr = function(NewPr)
{ {
History.Add(this, new CChangesMathEqArrayPr(NewPr, this.Pr)); History.Add(this, new CChangesMathEqArrayPr(NewPr, this.Pr));
...@@ -714,7 +716,7 @@ CEqArray.prototype.raw_SetPr = function(NewPr) ...@@ -714,7 +716,7 @@ CEqArray.prototype.raw_SetPr = function(NewPr)
{ {
this.Pr = NewPr; this.Pr = NewPr;
this.private_SetNeedResize(); this.private_SetNeedResize();
} };
CEqArray.prototype.fillContent = function() CEqArray.prototype.fillContent = function()
{ {
var nRowsCount = this.Content.length; var nRowsCount = this.Content.length;
...@@ -745,7 +747,7 @@ CEqArray.prototype.Resize = function(oMeasure, RPI) ...@@ -745,7 +747,7 @@ CEqArray.prototype.Resize = function(oMeasure, RPI)
this.elements[i][0].Resize(oMeasure, NewRPI); this.elements[i][0].Resize(oMeasure, NewRPI);
this.recalculateSize(oMeasure); this.recalculateSize(oMeasure);
} };
CEqArray.prototype.getMetrics = function() CEqArray.prototype.getMetrics = function()
{ {
var AscentsMetrics = []; var AscentsMetrics = [];
...@@ -839,8 +841,8 @@ CEqArray.prototype.getMetrics = function() ...@@ -839,8 +841,8 @@ CEqArray.prototype.getMetrics = function()
} }
return {ascents: AscentsMetrics, descents: DescentsMetrics, widths: WidthsMetrics}; return {ascents: AscentsMetrics, descents: DescentsMetrics, widths: WidthsMetrics};
} };
CEqArray.prototype.setPosition = function(pos, Line, Range) CEqArray.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
{ {
this.pos.x = pos.x; this.pos.x = pos.x;
...@@ -862,17 +864,17 @@ CEqArray.prototype.setPosition = function(pos, Line, Range) ...@@ -862,17 +864,17 @@ CEqArray.prototype.setPosition = function(pos, Line, Range)
NewPos.x = this.pos.x + this.GapLeft; NewPos.x = this.pos.x + this.GapLeft;
NewPos.y = this.pos.y + h + Item.size.ascent; NewPos.y = this.pos.y + h + Item.size.ascent;
Item.setPosition(NewPos, Line, Range); Item.setPosition(NewPos, PRSA, Line, Range, Page);
h += Heights[i] + this.gaps.row[i]; h += Heights[i] + this.gaps.row[i];
} }
pos.x += this.size.width; pos.x += this.size.width;
} };
CEqArray.prototype.getElement = function(num) CEqArray.prototype.getElement = function(num)
{ {
return this.elements[num][0]; return this.elements[num][0];
} };
CEqArray.prototype.getElementMathContent = function(Index) CEqArray.prototype.getElementMathContent = function(Index)
{ {
return this.Content[Index]; return this.Content[Index];
......
This diff is collapsed.
...@@ -2939,7 +2939,7 @@ COperator.prototype.draw = function(x, y, pGraphics, PDSE) ...@@ -2939,7 +2939,7 @@ COperator.prototype.draw = function(x, y, pGraphics, PDSE)
if(this.typeOper === OPERATOR_TEXT) if(this.typeOper === OPERATOR_TEXT)
{ {
this.drawText(XX, YY, pGraphics, PDSE); this.drawText(x, y, pGraphics, PDSE);
} }
else if(this.IsLineGlyph()) else if(this.IsLineGlyph())
{ {
...@@ -2957,11 +2957,6 @@ COperator.prototype.setPosition = function(_pos) ...@@ -2957,11 +2957,6 @@ COperator.prototype.setPosition = function(_pos)
if(this.typeOper === OPERATOR_TEXT) if(this.typeOper === OPERATOR_TEXT)
{ {
/*var pos = new CMathPosition();
pos.x = 0;
pos.y = 0;*/
this.operator.setPosition(_pos); this.operator.setPosition(_pos);
} }
}; };
...@@ -3490,6 +3485,13 @@ CDelimiter.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) ...@@ -3490,6 +3485,13 @@ CDelimiter.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
this.BrGapLeft = this.GapLeft + this.begOper.size.width; this.BrGapLeft = this.GapLeft + this.begOper.size.width;
this.BrGapRight = this.GapRight + this.endOper.size.width; this.BrGapRight = this.GapRight + this.endOper.size.width;
}; };
CDelimiter.prototype.Is_EmptyGaps = function()
{
var Height = g_oTextMeasurer.GetHeight();
var result = this.GeneralMetrics.size.height < Height;
return result;
};
CDelimiter.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _CurRange) CDelimiter.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _CurRange)
{ {
var CurLine = _CurLine - this.StartLine; var CurLine = _CurLine - this.StartLine;
...@@ -3652,7 +3654,7 @@ CDelimiter.prototype.GetAscentOperator = function(operator) // в качеств ...@@ -3652,7 +3654,7 @@ CDelimiter.prototype.GetAscentOperator = function(operator) // в качеств
return Ascent; return Ascent;
}; };
CDelimiter.prototype.setPosition = function(pos, Line, Range) CDelimiter.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
{ {
var CurLine = Line - this.StartLine; var CurLine = Line - this.StartLine;
var CurRange = ( 0 === CurLine ? Range - this.StartRange : Range ); var CurRange = ( 0 === CurLine ? Range - this.StartRange : Range );
...@@ -3670,7 +3672,7 @@ CDelimiter.prototype.setPosition = function(pos, Line, Range) ...@@ -3670,7 +3672,7 @@ CDelimiter.prototype.setPosition = function(pos, Line, Range)
this.UpdatePosOperBeg(pos, Line); this.UpdatePosOperBeg(pos, Line);
} }
this.Content[0].setPosition(pos, Line, Range); this.Content[0].setPosition(pos, PRSA, Line, Range, Page);
if(LinesCount - 1 == CurLine) if(LinesCount - 1 == CurLine)
{ {
...@@ -3691,7 +3693,7 @@ CDelimiter.prototype.setPosition = function(pos, Line, Range) ...@@ -3691,7 +3693,7 @@ CDelimiter.prototype.setPosition = function(pos, Line, Range)
this.UpdatePosOperBeg(CurrPos, Line); this.UpdatePosOperBeg(CurrPos, Line);
this.Content[0].setPosition(CurrPos, Line, Range); // CMathContent this.Content[0].setPosition(CurrPos, PRSA, Line, Range, Page); // CMathContent
var PosSep = new CMathPosition(); var PosSep = new CMathPosition();
PosSep.x = CurrPos.x; PosSep.x = CurrPos.x;
...@@ -3704,7 +3706,7 @@ CDelimiter.prototype.setPosition = function(pos, Line, Range) ...@@ -3704,7 +3706,7 @@ CDelimiter.prototype.setPosition = function(pos, Line, Range)
{ {
CurrPos.x += this.sepOper.size.width; CurrPos.x += this.sepOper.size.width;
this.Content[j].setPosition(CurrPos, Line, Range); this.Content[j].setPosition(CurrPos, PRSA, Line, Range, Page);
pos.x += this.Content[j].size.width; pos.x += this.Content[j].size.width;
} }
...@@ -3857,9 +3859,11 @@ CCharacter.prototype.recalculateSize = function(oMeasure) ...@@ -3857,9 +3859,11 @@ CCharacter.prototype.recalculateSize = function(oMeasure)
width += this.GapLeft + this.GapRight; width += this.GapLeft + this.GapRight;
this.size = {height: height, width: width, ascent: ascent}; this.size.height = height;
this.size.width = width;
this.size.ascent = ascent;
}; };
CCharacter.prototype.setPosition = function(pos, Line, Range) CCharacter.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
{ {
this.pos.x = pos.x; this.pos.x = pos.x;
this.pos.y = pos.y - this.size.ascent; this.pos.y = pos.y - this.size.ascent;
...@@ -3884,14 +3888,14 @@ CCharacter.prototype.setPosition = function(pos, Line, Range) ...@@ -3884,14 +3888,14 @@ CCharacter.prototype.setPosition = function(pos, Line, Range)
PosBase.x = this.pos.x + this.GapLeft + alignCnt; PosBase.x = this.pos.x + this.GapLeft + alignCnt;
PosBase.y = this.pos.y + this.operator.size.height + Base.size.ascent; PosBase.y = this.pos.y + this.operator.size.height + Base.size.ascent;
Base.setPosition(PosBase, Line, Range); Base.setPosition(PosBase, PRSA, Line, Range, Page);
} }
else if(this.Pr.pos === LOCATION_BOT) else if(this.Pr.pos === LOCATION_BOT)
{ {
PosBase.x = this.pos.x + this.GapLeft + alignCnt; PosBase.x = this.pos.x + this.GapLeft + alignCnt;
PosBase.y = this.pos.y + Base.size.ascent; PosBase.y = this.pos.y + Base.size.ascent;
Base.setPosition(PosBase, Line, Range); Base.setPosition(PosBase, PRSA, Line, Range, Page);
PosOper.x = this.pos.x + this.GapLeft + alignOp; PosOper.x = this.pos.x + this.GapLeft + alignOp;
PosOper.y = this.pos.y + Base.size.height; PosOper.y = this.pos.y + Base.size.height;
......
...@@ -5,7 +5,7 @@ function CSignRadical() ...@@ -5,7 +5,7 @@ function CSignRadical()
this.Parent = null; this.Parent = null;
this.pos = null; this.pos = null;
this.size = null; this.size = new CMathSize();
this.gapArg = 0; this.gapArg = 0;
this.gapSign = 0; /// расстояние до значка радикала this.gapSign = 0; /// расстояние до значка радикала
...@@ -112,7 +112,7 @@ CSignRadical.prototype.new_draw = function(x, y, pGraphics) ...@@ -112,7 +112,7 @@ CSignRadical.prototype.new_draw = function(x, y, pGraphics)
pGraphics._l(x5 + penW/3*sin, y4 - penW/5); pGraphics._l(x5 + penW/3*sin, y4 - penW/5);
pGraphics.ds(); pGraphics.ds();
} };
CSignRadical.prototype.draw = function(x, y, pGraphics, PDSE) CSignRadical.prototype.draw = function(x, y, pGraphics, PDSE)
{ {
var txtPrp = this.Parent.Get_CompiledCtrPrp(); var txtPrp = this.Parent.Get_CompiledCtrPrp();
...@@ -210,7 +210,7 @@ CSignRadical.prototype.draw = function(x, y, pGraphics, PDSE) ...@@ -210,7 +210,7 @@ CSignRadical.prototype.draw = function(x, y, pGraphics, PDSE)
pGraphics.ds(); pGraphics.ds();
} };
CSignRadical.prototype.recalculateSize = function(oMeasure, sizeArg) CSignRadical.prototype.recalculateSize = function(oMeasure, sizeArg)
{ {
var txtPrp = this.Parent.Get_CompiledCtrPrp(); var txtPrp = this.Parent.Get_CompiledCtrPrp();
...@@ -322,16 +322,17 @@ CSignRadical.prototype.recalculateSize = function(oMeasure, sizeArg) ...@@ -322,16 +322,17 @@ CSignRadical.prototype.recalculateSize = function(oMeasure, sizeArg)
height += this.gapSign; height += this.gapSign;
////////////////////////////// //////////////////////////////
this.size = {height: height, width: width}; this.size.height = height;
} this.size.width = width;
};
CSignRadical.prototype.setPosition = function(pos) CSignRadical.prototype.setPosition = function(pos)
{ {
this.pos = pos; this.pos = pos;
} };
CSignRadical.prototype.relate = function(parent) CSignRadical.prototype.relate = function(parent)
{ {
this.Parent = parent; this.Parent = parent;
} };
function CMathRadicalPr() function CMathRadicalPr()
{ {
...@@ -419,7 +420,7 @@ CRadical.prototype.init = function(props) ...@@ -419,7 +420,7 @@ CRadical.prototype.init = function(props)
this.Fill_LogicalContent(2); this.Fill_LogicalContent(2);
this.fillContent(); this.fillContent();
} };
CRadical.prototype.fillContent = function() CRadical.prototype.fillContent = function()
{ {
this.Iterator = this.getDegree(); this.Iterator = this.getDegree();
...@@ -447,7 +448,7 @@ CRadical.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo ...@@ -447,7 +448,7 @@ CRadical.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo
if(this.bInside == false) if(this.bInside == false)
GapsInfo.setGaps(this, this.TextPrControlLetter.FontSize); GapsInfo.setGaps(this, this.TextPrControlLetter.FontSize);
} };
CRadical.prototype.ApplyProperties = function(RPI) CRadical.prototype.ApplyProperties = function(RPI)
{ {
if(this.RecalcInfo.bProps) if(this.RecalcInfo.bProps)
...@@ -496,7 +497,7 @@ CRadical.prototype.ApplyProperties = function(RPI) ...@@ -496,7 +497,7 @@ CRadical.prototype.ApplyProperties = function(RPI)
this.RecalcInfo.bProps = false; this.RecalcInfo.bProps = false;
} }
} };
CRadical.prototype.recalculateSize = function(oMeasure) CRadical.prototype.recalculateSize = function(oMeasure)
{ {
var shTop, var shTop,
...@@ -527,8 +528,6 @@ CRadical.prototype.recalculateSize = function(oMeasure) ...@@ -527,8 +528,6 @@ CRadical.prototype.recalculateSize = function(oMeasure)
//ascent = height - (base.height - base.ascent); //ascent = height - (base.height - base.ascent);
width += this.GapLeft + this.GapRight; width += this.GapLeft + this.GapRight;
this.size = {width: width, height: height, ascent: ascent};
} }
else if(this.Pr.type == DEGREE_RADICAL) else if(this.Pr.type == DEGREE_RADICAL)
{ {
...@@ -571,10 +570,12 @@ CRadical.prototype.recalculateSize = function(oMeasure) ...@@ -571,10 +570,12 @@ CRadical.prototype.recalculateSize = function(oMeasure)
} }
this.gapDegree = height - h1 + gapHeight; this.gapDegree = height - h1 + gapHeight;
this.size = {width: width, height: height, ascent: ascent};
} }
}
this.size.height = height;
this.size.width = width;
this.size.ascent = ascent;
};
CRadical.prototype.Resize = function(oMeasure, RPI) CRadical.prototype.Resize = function(oMeasure, RPI)
{ {
if(this.Pr.type == SQUARE_RADICAL) if(this.Pr.type == SQUARE_RADICAL)
...@@ -586,8 +587,8 @@ CRadical.prototype.Resize = function(oMeasure, RPI) ...@@ -586,8 +587,8 @@ CRadical.prototype.Resize = function(oMeasure, RPI)
} }
this.recalculateSize(oMeasure); this.recalculateSize(oMeasure);
} };
CRadical.prototype.setPosition = function(pos, Line, Range) CRadical.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
{ {
this.pos.x = pos.x; this.pos.x = pos.x;
this.pos.y = pos.y - this.size.ascent; this.pos.y = pos.y - this.size.ascent;
...@@ -607,7 +608,7 @@ CRadical.prototype.setPosition = function(pos, Line, Range) ...@@ -607,7 +608,7 @@ CRadical.prototype.setPosition = function(pos, Line, Range)
PosBase.y = this.pos.y + gapTop + this.RealBase.size.ascent; PosBase.y = this.pos.y + gapTop + this.RealBase.size.ascent;
this.signRadical.setPosition(PosRadical); this.signRadical.setPosition(PosRadical);
this.RealBase.setPosition(PosBase, Line, Range); this.RealBase.setPosition(PosBase, PRSA, Line, Range, Page);
} }
else if(this.Pr.type == DEGREE_RADICAL) else if(this.Pr.type == DEGREE_RADICAL)
{ {
...@@ -618,7 +619,7 @@ CRadical.prototype.setPosition = function(pos, Line, Range) ...@@ -618,7 +619,7 @@ CRadical.prototype.setPosition = function(pos, Line, Range)
PosDegree.x = this.pos.x + this.GapLeft + this.gapWidth; PosDegree.x = this.pos.x + this.GapLeft + this.gapWidth;
PosDegree.y = this.pos.y + this.gapDegree + this.Iterator.size.ascent; PosDegree.y = this.pos.y + this.gapDegree + this.Iterator.size.ascent;
this.Iterator.setPosition(PosDegree, Line, Range); this.Iterator.setPosition(PosDegree, PRSA, Line, Range, Page);
var wDegree = this.Iterator.size.width > wTick ? this.Iterator.size.width - wTick : 0; var wDegree = this.Iterator.size.width > wTick ? this.Iterator.size.width - wTick : 0;
...@@ -630,11 +631,11 @@ CRadical.prototype.setPosition = function(pos, Line, Range) ...@@ -630,11 +631,11 @@ CRadical.prototype.setPosition = function(pos, Line, Range)
PosBase.x = this.pos.x + this.size.width - this.RealBase.size.width - this.GapRight; PosBase.x = this.pos.x + this.size.width - this.RealBase.size.width - this.GapRight;
PosBase.y = this.pos.y + this.size.ascent; PosBase.y = this.pos.y + this.size.ascent;
this.RealBase.setPosition(PosBase, Line, Range); this.RealBase.setPosition(PosBase, PRSA, Line, Range, Page);
} }
pos.x += this.size.width; pos.x += this.size.width;
} };
CRadical.prototype.Draw_Elements = function(PDSE) CRadical.prototype.Draw_Elements = function(PDSE)
{ {
var X = PDSE.X; var X = PDSE.X;
...@@ -645,15 +646,15 @@ CRadical.prototype.Draw_Elements = function(PDSE) ...@@ -645,15 +646,15 @@ CRadical.prototype.Draw_Elements = function(PDSE)
CRadical.superclass.Draw_Elements.call(this, PDSE); CRadical.superclass.Draw_Elements.call(this, PDSE);
PDSE.X = X + this.size.width; PDSE.X = X + this.size.width;
} };
CRadical.prototype.getBase = function() CRadical.prototype.getBase = function()
{ {
return this.Content[1]; return this.Content[1];
} };
CRadical.prototype.getDegree = function() CRadical.prototype.getDegree = function()
{ {
return this.Content[0]; return this.Content[0];
} };
CRadical.prototype.Document_UpdateInterfaceState = function(MathProps) CRadical.prototype.Document_UpdateInterfaceState = function(MathProps)
{ {
MathProps.Type = c_oAscMathInterfaceType.Radical; MathProps.Type = c_oAscMathInterfaceType.Radical;
......
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