Commit 3553049a authored by Anna.Pavlova's avatar Anna.Pavlova

Поправила setPosition для mathText (из-за последних правок just-draw элементы...

Поправила setPosition для mathText (из-за последних правок just-draw элементы отображались в некорректной позции)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58001 954022d7-b5bf-4e40-9824-e11837661b57
parent 8348db6d
...@@ -7726,26 +7726,28 @@ ParaRun.prototype.old_Math_SetPosition = function(pos, PosInfo, CurrWPoints) ...@@ -7726,26 +7726,28 @@ ParaRun.prototype.old_Math_SetPosition = function(pos, PosInfo, CurrWPoints)
} }
ParaRun.prototype.Math_SetPosition = function(PosInfo) ParaRun.prototype.Math_SetPosition = function(PosInfo)
{ {
var NewPos = new CMathPosition();
var x = PosInfo.x,
y = PosInfo.y - this.size.ascent;
if(this.bEqqArray) if(this.bEqqArray)
{ {
for(var Pos = 0; Pos < this.Content.length; Pos++) for(var Pos = 0; Pos < this.Content.length; Pos++)
{ {
var CurrElem = this.Content[Pos]; var CurrElem = this.Content[Pos];
var NewPos = new CMathPosition();
NewPos.x = PosInfo.x;
NewPos.y = PosInfo.y - this.size.ascent;
if(this.Content[Pos].Type == para_Math_Ampersand) if(this.Content[Pos].Type == para_Math_Ampersand)
{ {
PosInfo.UpdatePoint(); PosInfo.UpdatePoint();
PosInfo.ApplyAlign(); PosInfo.ApplyAlign();
CurrElem.setPosition(PosInfo.x, y); CurrElem.setPosition(NewPos);
} }
else else
{ {
CurrElem.setPosition(PosInfo.x, y); CurrElem.setPosition(NewPos);
} }
PosInfo.UpdateX(CurrElem.size.width); PosInfo.UpdateX(CurrElem.size.width);
...@@ -7897,7 +7899,12 @@ ParaRun.prototype.Math_SetPosition = function(PosInfo) ...@@ -7897,7 +7899,12 @@ ParaRun.prototype.Math_SetPosition = function(PosInfo)
{ {
for(var i = 0; i < this.Content.length; i++) for(var i = 0; i < this.Content.length; i++)
{ {
this.Content[i].setPosition(PosInfo.x, y); var NewPos = new CMathPosition();
NewPos.x = PosInfo.x;
NewPos.y = PosInfo.y - this.size.ascent;
this.Content[i].setPosition(NewPos);
PosInfo.x += this.Content[i].size.width; PosInfo.x += this.Content[i].size.width;
} }
......
...@@ -4303,7 +4303,7 @@ CMathContent.prototype = ...@@ -4303,7 +4303,7 @@ CMathContent.prototype =
setPosition: function(PosInfo) setPosition: function(PosInfo)
{ {
this.pos.x = PosInfo.x; this.pos.x = PosInfo.x;
this.pos.y = PosInfo.y ; this.pos.y = PosInfo.y;
/*var x = pos.x, /*var x = pos.x,
y = pos.y + this.size.ascent; */ y = pos.y + this.size.ascent; */
......
...@@ -559,19 +559,19 @@ CMathText.prototype = ...@@ -559,19 +559,19 @@ CMathText.prototype =
pGraphics.FillTextCode(X, Y, this.getCode()); //на отрисовку символа отправляем положение baseLine pGraphics.FillTextCode(X, Y, this.getCode()); //на отрисовку символа отправляем положение baseLine
}, },
setPosition: function(X, Y) setPosition: function(pos)
{ {
try try
{ {
if (!this.bJDraw) // for text if (!this.bJDraw) // for text
{ {
this.pos.x = X + this.GapLeft; this.pos.x = pos.x + this.GapLeft;
this.pos.y = Y; this.pos.y = pos.y;
} }
else // for symbol only drawing else // for symbol only drawing
{ {
this.pos.x = X - this.rasterOffsetX; this.pos.x = pos.x - this.rasterOffsetX;
this.pos.y = Y - this.rasterOffsetY + this.size.ascent; this.pos.y = pos.y - this.rasterOffsetY + this.size.ascent;
} }
} }
catch(e) catch(e)
...@@ -751,13 +751,13 @@ CMathAmp.prototype = ...@@ -751,13 +751,13 @@ CMathAmp.prototype =
}; };
} }
}, },
setPosition: function(X, Y) setPosition: function(pos)
{ {
this.pos.x = X; this.pos.x = pos.x;
this.pos.y = Y; this.pos.y = pos.y;
if(this.bEqqArray==false) if(this.bEqqArray==false)
this.AmpText.setPosition(X, Y); this.AmpText.setPosition(pos);
}, },
draw: function(x, y, pGraphics) draw: function(x, y, pGraphics)
{ {
......
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