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

1. Поправила кол-во Bounds у контентов и math composition : теперь если не быстрый пересчет,

то массив Bounds обрезается до номера текущей строки (для того чтобы избежать случая, 
когда при переносе под плавающие объекты кол-во строк уменьшается и кол-во bounds соответственно тоже)
2. Поправила баг : неправильное кол-во Bounds у итераторов в CDegreeSubSups : отсутствовsал Reset для iters

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@65547 954022d7-b5bf-4e40-9824-e11837661b57
parent 018f146a
......@@ -2083,9 +2083,9 @@ CMathBase.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _C
var CurLine = _CurLine - this.StartLine;
var CurRange = (0 === CurLine ? _CurRange - this.StartRange : _CurRange);
if(CurLine == 0 && CurRange == 0)
if(PRS.bFastRecalculate === false)
{
this.Bounds.Reset();
this.Bounds.Reset(CurLine, CurRange);
}
var StartPos, EndPos;
......@@ -2319,9 +2319,10 @@ function CMathBounds()
{
this.Bounds = [];
}
CMathBounds.prototype.Reset = function()
CMathBounds.prototype.Reset = function(CurLine, CurRange)
{
this.Bounds.length = 0;
if(CurRange == 0)
this.Bounds.length = CurLine;
};
CMathBounds.prototype.CheckLineBound = function(Line, Range)
{
......
......@@ -433,9 +433,9 @@ CDegree.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _Cur
var CurLine = _CurLine - this.StartLine;
var CurRange = (0 === CurLine ? _CurRange - this.StartRange : _CurRange);
if(CurLine == 0 && CurRange == 0)
if(PRS.bFastRecalculate === false)
{
this.Bounds.Reset();
this.Bounds.Reset(CurLine, CurRange);
}
if(this.bOneLine == false && this.baseContent.Math_Is_End( _CurLine, _CurRange))
......@@ -842,9 +842,9 @@ CDegreeSubSup.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine
var CurLine = _CurLine - this.StartLine;
var CurRange = (0 === CurLine ? _CurRange - this.StartRange : _CurRange);
if(CurLine == 0 && CurRange == 0)
if(PRS.bFastRecalculate === false)
{
this.Bounds.Reset();
this.Bounds.Reset(CurLine, CurRange);
}
if(this.bOneLine === false && true === this.Need_Iters(_CurLine, _CurRange))
......@@ -864,7 +864,8 @@ CDegreeSubSup.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine
this.Bounds.UpdateMetrics(CurLine, CurRange, Bound);
ContentMetrics.UpdateMetrics(Bound);
this.iters.Bounds.Reset();
this.iters.Recalculate_Reset( PRS.Range, PRS.Line, PRS );
this.iters.Bounds.Reset(0, 0);
this.iters.Bounds.UpdateMetrics(0, 0, this.iters.size);
this.UpdatePRS(PRS, Bound);
......
......@@ -4397,9 +4397,9 @@ CMathContent.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine,
var StartPos = this.protected_GetRangeStartPos(CurLine, CurRange);
var EndPos = this.protected_GetRangeEndPos(CurLine, CurRange);
if(CurLine == 0 && CurRange == 0)
if(PRS.bFastRecalculate === false)
{
this.Bounds.Reset();
this.Bounds.Reset(CurLine, CurRange);
}
var NewContentMetrics = new CMathBoundsMeasures();
......
......@@ -622,6 +622,11 @@ CNary.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _CurRa
var CurLine = _CurLine - this.StartLine;
var CurRange = (0 === CurLine ? _CurRange - this.StartRange : _CurRange);
if(PRS.bFastRecalculate === false)
{
this.Bounds.Reset(CurLine, CurRange);
}
// т.к. ParaNumbering привязывается к первому текстовому элементы, он может находится в аргументе
// обновляем LineMetrics для Base после того, как обновим метрики для аргумента
......@@ -630,13 +635,11 @@ CNary.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _CurRa
var BoundArg = this.Arg.Get_LineBound(_CurLine, _CurRange);
this.Bounds.UpdateMetrics(CurLine, CurRange, BoundArg);
this.UpdatePRS(PRS, BoundArg);
if(CurLine == 0 && CurRange == 0)
{
this.Bounds.Reset();
//this.Bounds.Reset();
if(this.Base.IsJustDraw())
{
......
......@@ -20,101 +20,6 @@ function CSignRadical()
//this.sizeTick = null;
//this.widthSlash = null;
}
CSignRadical.prototype.new_draw = function(x, y, pGraphics)
{
var txtPrp = this.Parent.Get_CompiledCtrPrp();
//var txtPrp = this.Parent.getTxtPrp();
var penW = txtPrp.FontSize*g_dKoef_pt_to_mm*0.042;
y += this.gapTop + penW/2; // смещаем, для отрисовки верхней линии радикала
var x1 = this.pos.x + x,
x2 = x1 + 0.048*txtPrp.FontSize;
var Height = this.size.height - this.gapTop;
var y2 = this.pos.y + y + Height - this.measure.heightTick,
y1 = y2 + 0.0242*txtPrp.FontSize;
var tg = 0.048/0.0242;
var tX = tg*0.85*penW,
tY = 0.92*penW / tg;
var x3 = x2,
y3 = y2 - tY;
//var plH = 9.877777777777776 * txtPrp.FontSize /36;
var sin = 0.876,
cos = 0.474;
var y4 = this.pos.y + y + Height - penW;
var y5 = y4 + penW/2*cos;
// 0.048*txtPrp.FontSize + (- penW + this.measure.heightTick + 0.92*penW / tg )/ tg
var x4, x5;
if( !this.measure.bHigh )
{
x4 = x3 + (y4-y3)/tg;
x5 = x4 + penW/2*sin;
}
else
{
x4 = x1 + this.measure.widthSlash - penW/3*sin;
x5 = x1 + this.measure.widthSlash;
}
var x6 = x1 + this.measure.widthSlash,
x7 = this.pos.x + x + this.size.width;
var y6 = this.pos.y + y,
y7 = this.pos.y + y;
pGraphics.p_width(penW*0.8*1000);
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
pGraphics._m(x1, y1);
pGraphics._l(x2, y2);
pGraphics.ds();
pGraphics.p_width(1.7*penW*1000);
pGraphics._s();
pGraphics._m(x3, y3);
pGraphics._l(x4, y4);
pGraphics.ds();
pGraphics.p_width(penW*1000);
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
pGraphics.p_width(penW*1000);
pGraphics._s();
pGraphics._m(x5, y5);
pGraphics._l(x6, y6);
pGraphics._l(x7, y7);
pGraphics.ds();
pGraphics.p_color(0,0,0, 255);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
pGraphics._m(x4 - penW*0.6*sin, y4 - penW/5);
pGraphics._l(x5 + penW/3*sin, y4 - penW/5);
pGraphics.ds();
pGraphics._s();
};
CSignRadical.prototype.draw = function(x, y, pGraphics, PDSE)
{
var txtPrp = this.Parent.Get_CompiledCtrPrp();
......
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