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

1. Поправила баг с текстовым элементом в качестве Accent

2. Поправила Get_ParaContentPosByXY (параметры, которые передаются в Run)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57001 954022d7-b5bf-4e40-9824-e11837661b57
parent 388b3d65
......@@ -1263,15 +1263,12 @@ ParaMath.prototype =
var X = SearchPos.X,
Y = SearchPos.Y;
//SearchPos.X -= this.Math.absPos.x;
//SearchPos.Y -= this.Math.absPos.y;
SearchPos.X -= this.X;
SearchPos.Y -= this.Y;
this.Root.Get_ParaContentPosByXY(SearchPos, Depth);
this.Root.Get_ParaContentPosByXY(SearchPos, Depth, _CurLine, _CurRange, StepEnd);
SearchPos.X = X;
SearchPos.Y = Y;
......
......@@ -512,6 +512,9 @@ function CAccent(props)
chrType: null
};
this.shiftX = 0;
this.gap = 0;
/////////////////
this.operator = new COperator(OPER_ACCENT);
......@@ -1075,7 +1078,7 @@ CAccent.prototype.setPosition = function(pos)
var PosOper = new CMathPosition();
PosOper.x = this.pos.x + this.GapLeft + alignOp;
PosOper.y = this.pos.y;
PosOper.y = this.pos.y + this.shiftX;
// TODO
// выставить правильно смещение для остальных значков
......@@ -1093,17 +1096,12 @@ CAccent.prototype.setPosition = function(pos)
var PosBase = new CMathPosition();
PosBase.x = this.pos.x + this.GapLeft + alignCnt;
PosBase.y = this.pos.y + this.operator.size.height;
PosBase.y = this.pos.y + this.operator.size.height + this.gap;
this.elements[0][0].setPosition(PosBase);
}
CAccent.prototype.getPropsForWrite = function()
{
/*var props = {};
props.chr = String.fromCharCode(this.code);
return props;*/
return this.Pr;
}
CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure)
......@@ -1111,12 +1109,6 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure)
this.Parent = Parent;
this.ParaMath = ParaMath;
/*if(this.RecalcInfo.bCtrPrp == true)
{
this.Set_CompiledCtrPrp();
this.RecalcInfo.bCtrPrp = false;
}*/
if(this.RecalcInfo.bProps == true)
{
var prp =
......@@ -1132,9 +1124,6 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure)
};
this.operator.mergeProperties(prp, defaultPrp);
/*this.Pr.chr = String.fromCharCode(this.operator.code);
this.Pr.chrType = this.operator.typeOper;*/
}
this.operator.relate(this);
......@@ -1150,11 +1139,13 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure)
var letterX = new CMathText(true);
letterX.add(0x78);
letterX.Resize(null, oMeasure);
this.shiftX = base.size.ascent - letterX.size.ascent;
//this.shiftX = base.size.ascent - letterX.size.ascent;
this.gap = this.operator.size.ascentSign - letterX.size.ascent;
this.shiftX = this.operator.size.ascentSign;
var width = base.size.width > this.operator.size.width ? base.size.width : this.operator.size.width,
height = base.size.height + this.operator.size.height + this.shiftX,
ascent = this.operator.size.height + this.elements[0][0].size.ascent;
height = base.size.height + this.operator.size.height + this.gap,
ascent = this.operator.size.height + this.gap + this.elements[0][0].size.ascent;
this.size = {height: height, width: width, ascent: ascent};
}
......
......@@ -1264,7 +1264,7 @@ CMathBase.prototype =
},
/// Position for Paragraph
Get_ParaContentPosByXY: function(SearchPos, Depth)
Get_ParaContentPosByXY: function(SearchPos, Depth, _CurLine, _CurRange, StepEnd)
{
/// элементов just-draw не должно прийти
......@@ -1289,7 +1289,7 @@ CMathBase.prototype =
SearchPos.Y = disp.mCoord.y;
this.elements[disp.pos.x][disp.pos.y].Get_ParaContentPosByXY(SearchPos, Depth);
this.elements[disp.pos.x][disp.pos.y].Get_ParaContentPosByXY(SearchPos, Depth, _CurLine, _CurRange, StepEnd);
},
Get_ParaContentPos: function(bSelection, bStart, ContentPos)
{
......
......@@ -6138,7 +6138,7 @@ CMathContent.prototype =
},
/// функции для работы с курсором
Get_ParaContentPosByXY: function(SearchPos, Depth)
Get_ParaContentPosByXY: function(SearchPos, Depth, _CurLine, _CurRange, StepEnd)
{
if(this.content.length > 0) // случай , если у нас контент не заполнен, не предусмотрен
{
......@@ -6153,17 +6153,17 @@ CMathContent.prototype =
if(this.content[pos].typeObj == MATH_COMP)
{
SearchPos.Y -= this.size.ascent - this.content[pos].size.ascent;
this.content[pos].Get_ParaContentPosByXY(SearchPos, Depth);
this.content[pos].Get_ParaContentPosByXY(SearchPos, Depth, _CurLine, _CurRange, StepEnd);
}
else if(this.content[pos].typeObj == MATH_PARA_RUN) // проверка на gaps в findDisposition
{
SearchPos.X += this.pos.x + this.ParaMath.X + this.WidthToElement[pos];
SearchPos.CurX += this.pos.x + this.WidthToElement[pos];
this.content[pos].Get_ParaContentPosByXY(SearchPos, Depth, 0, 0);
this.content[pos].Get_ParaContentPosByXY(SearchPos, Depth, _CurLine, _CurRange, StepEnd);
}
else
{
this.content[pos].Get_ParaContentPosByXY(SearchPos, Depth);
this.content[pos].Get_ParaContentPosByXY(SearchPos, Depth, _CurLine, _CurRange, StepEnd);
}
}
},
......
......@@ -329,7 +329,6 @@ CMathText.prototype =
this.pos.x = pos.x + this.GapLeft;
this.pos.y = pos.y;
//this.pos = {x : pos.x + this.GapLeft, y: pos.y};
}
else // for symbol only drawing
{
......@@ -440,7 +439,7 @@ CMathText.prototype =
},
Get_ParaContentPosByXY: function(SearchPos, Depth)
Get_ParaContentPosByXY: function(SearchPos, Depth, _CurLine, _CurRange, StepEnd)
{
SearchPos.Pos.Update(0, Depth);
SearchPos.Pos.bPlaceholder = true;
......
......@@ -2144,108 +2144,6 @@ CCombining_LR_Arrow.prototype.calcCoord = function(stretch)
}
function old_CSeparatorDelimiter()
{
CDelimiter.call(this);
}
extend(old_CSeparatorDelimiter, CDelimiter);
old_CSeparatorDelimiter.prototype.init = function(type, column)
{
var base = new CSeparator();
base.init(column);
var params =
{
type: type,
loc: 4,
turn1: 0,
turn2: 1
};
this.init_2(params, base);
}
old_CSeparatorDelimiter.prototype.mouseMove = function(mCoord)
{
var elem = this.findDisposition( mCoord);
var state = true,
SelectContent = null;
if(elem.pos.x == this.CurPos_X && elem.pos.y == this.CurPos_Y && elem.inside_flag === -1 )
{
var movement = this.elements[this.CurPos_X][this.CurPos_Y].mouseMove(elem.mCoord);
SelectContent = movement.SelectContent;
state = movement.state;
}
else
{
state = false;
}
return {state: state, SelectContent: SelectContent};
}
function old_old_CSeparator()
{
this.sepChr = 0x7C; // default
CMathBase.call(this);
}
extend(old_old_CSeparator, CMathBase);
old_old_CSeparator.prototype.init = function(sepChr, column)
{
if(sepChr !== "undefined" && sepChr !== null)
this.sepChr = sepChr.charCodeAt(0);
this.setDimension(1, column);
this.setContent();
}
old_old_CSeparator.prototype.setDistance = function()
{
this.dW = this.getTxtPrp().FontSize/3*g_dKoef_pt_to_mm;
}
old_old_CSeparator.prototype.draw = function()
{
//if(this.sepChr == )
old_old_CSeparator.superclass.draw.call(this);
}
old_old_CSeparator.prototype.drawHorLine = function()
{
var x = this.pos.x,
y = this.pos.y;
var w = this.elements[0][0].size.width + this.dW/2;
var intGrid = MathControl.pGraph.GetIntegerGrid();
MathControl.pGraph.SetIntegerGrid(false);
MathControl.pGraph.p_width(1000);
MathControl.pGraph.b_color1(0,0,0, 255);
var pW = this.getTxtPrp().FontSize/18*g_dKoef_pt_to_mm;
for(var i = 0; i < this.nCol - 1; i++)
{
var x1 = x + w - pW/2, y1 = y,
x2 = x + pW/2 + w, y2 = y,
x3 = x2, y3 = y + this.size.height,
x4 = x1, y4 = y3;
MathControl.pGraph._s();
MathControl.pGraph._m(x1, y1);
MathControl.pGraph._l(x2, y2);
MathControl.pGraph._l(x3, y3);
MathControl.pGraph._l(x4, y4);
MathControl.pGraph._l(x1, y1);
MathControl.pGraph.df();
w += this.elements[0][i+1].size.width + this.dW;
}
MathControl.pGraph.SetIntegerGrid(intGrid);
}
function COperator(type)
{
this.type = type; // delimiter, separator, group character, accent
......@@ -3142,6 +3040,7 @@ COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch)
if(this.typeOper !== OPERATOR_EMPTY)
{
var width, height, ascent;
var ascentSign = 0;
if(this.typeOper == OPERATOR_TEXT) // отдельный случай для текста в качестве оператора
......@@ -3171,6 +3070,8 @@ COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch)
height = this.operator.size.height;
}
ascentSign = this.operator.size.ascent;
/*var letterX = new CMathText(true);
letterX.add(0x78);
letterX.Resize(null, oMeasure);
......@@ -3205,7 +3106,7 @@ COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch)
else // vertical
ascent = height/2 + shCenter;
this.size = {width: width, height: height, ascent: ascent};
this.size = {width: width, height: height, ascent: ascent, ascentSign : ascentSign};
}
}
COperator.prototype.setPosition = function(Positions)
......@@ -3560,12 +3461,6 @@ CDelimiter.prototype.Resize = function(Parent, ParaMath, oMeasure)
this.Parent = Parent;
this.ParaMath = ParaMath;
/*if(this.RecalcInfo.bCtrPrp == true)
{
this.Set_CompiledCtrPrp();
this.RecalcInfo.bCtrPrp = false;
}*/
if(this.RecalcInfo.bProps == true)
{
var begPrp =
......
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