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

rasterOffsetX, rasterOffsetY for Accent

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55644 954022d7-b5bf-4e40-9824-e11837661b57
parent 05c41146
...@@ -566,6 +566,10 @@ CSign.prototype.init = function(props) ...@@ -566,6 +566,10 @@ CSign.prototype.init = function(props)
} }
} }
CSign.prototype.setPosition = function(pos) CSign.prototype.setPosition = function(pos)
{
this.sign.setPosition(pos);
}
/*CSign.prototype.setPosition = function(pos)
{ {
var shX = 0; var shX = 0;
...@@ -586,7 +590,7 @@ CSign.prototype.setPosition = function(pos) ...@@ -586,7 +590,7 @@ CSign.prototype.setPosition = function(pos)
y: pos.y + this.sign.size.ascent y: pos.y + this.sign.size.ascent
}; };
this.sign.setPosition(position); this.sign.setPosition(position);
} }*/
CSign.prototype.fixSize = function(oMeasure, stretch, bIncline) CSign.prototype.fixSize = function(oMeasure, stretch, bIncline)
{ {
var ctrPrp = this.Parent.getCtrPrp(); var ctrPrp = this.Parent.getCtrPrp();
......
...@@ -7614,6 +7614,7 @@ CMathContent.prototype = ...@@ -7614,6 +7614,7 @@ CMathContent.prototype =
ContentPos.Update(len, Depth); ContentPos.Update(len, Depth);
Depth++; Depth++;
if(len > 0)
this.content[len].Get_EndPos(BehindEnd, ContentPos, Depth); this.content[len].Get_EndPos(BehindEnd, ContentPos, Depth);
}, },
Get_Id : function() Get_Id : function()
......
...@@ -65,6 +65,8 @@ function CMathText(bJDraw) ...@@ -65,6 +65,8 @@ function CMathText(bJDraw)
this.type = TXT_ROMAN; this.type = TXT_ROMAN;
this.rasterOffsetX = 0;
this.rasterOffsetY = 0;
this.GapLeft = 0; this.GapLeft = 0;
this.GapRight = 0; this.GapRight = 0;
this.WidthVisible = 0; this.WidthVisible = 0;
...@@ -302,6 +304,9 @@ CMathText.prototype = ...@@ -302,6 +304,9 @@ CMathText.prototype =
var metricsTxt = oMeasure.Measure2Code(letter); var metricsTxt = oMeasure.Measure2Code(letter);
var width = metricsTxt.Width; var width = metricsTxt.Width;
this.rasterOffsetX = metricsTxt.rasterOffsetX;
this.rasterOffsetY = metricsTxt.rasterOffsetY;
var ascent = metricsTxt.Ascent; var ascent = metricsTxt.Ascent;
var descent = (metricsTxt.Height - metricsTxt.Ascent); var descent = (metricsTxt.Height - metricsTxt.Ascent);
var height = ascent + descent; var height = ascent + descent;
...@@ -411,13 +416,27 @@ CMathText.prototype = ...@@ -411,13 +416,27 @@ CMathText.prototype =
pGraphics.FillTextCode(xx, yy , this.getCode()); //на отрисовку символа отправляем положение baseLine pGraphics.FillTextCode(xx, yy , this.getCode()); //на отрисовку символа отправляем положение baseLine
//pGraphics.FillTextCode(xx, yy , this.value); //pGraphics.FillTextCode(xx, yy , this.value);
/*if(this.bJDraw)
{
console.log("Value: " + this.value);
console.log("RasterOffsetX : " + this.rasterOffsetX + ", RasterOffsetY : " + this.rasterOffsetY);
}*/
}, },
setPosition: function(pos) setPosition: function(pos)
{ {
if( ! this.bJDraw) // for text if( ! this.bJDraw) // for text
this.pos = {x : pos.x + this.GapLeft, y: pos.y }; this.pos = {x : pos.x + this.GapLeft, y: pos.y };
else // for symbol only drawing else // for symbol only drawing
this.pos = {x: pos.x + this.GapLeft, y: pos.y + this.size.ascent}; this.pos = {x: pos.x + this.rasterOffsetX, y: pos.y + this.rasterOffsetY};
//this.pos = {x: pos.x + this.GapLeft, y: pos.y + this.size.ascent};
/*if(this.bJDraw)
{
console.log("Value: " + this.value);
console.log("RasterOffsetX : " + this.rasterOffsetX + ", RasterOffsetY : " + this.rasterOffsetY);
}*/
}, },
setCoeffTransform: function(sx, shx, shy, sy) setCoeffTransform: function(sx, shx, shy, sy)
{ {
......
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