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

Поправила оператор (относится к ревизии 58575)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58631 954022d7-b5bf-4e40-9824-e11837661b57
parent 0fa6bf94
...@@ -1352,10 +1352,6 @@ function COperatorLine() ...@@ -1352,10 +1352,6 @@ function COperatorLine()
CGlyphOperator.call(this); CGlyphOperator.call(this);
} }
Asc.extendClass(COperatorLine, CGlyphOperator); Asc.extendClass(COperatorLine, CGlyphOperator);
COperatorLine.prototype.setContent = function()
{
COperatorLine.superclass.setContent.call(this, this.calcSize, this.calcCoord, this.drawPath);
}
COperatorLine.prototype.calcSize = function() COperatorLine.prototype.calcSize = function()
{ {
var betta = this.getCtrPrp().FontSize/36; var betta = this.getCtrPrp().FontSize/36;
...@@ -1382,7 +1378,6 @@ COperatorLine.prototype.calcCoord = function(stretch) ...@@ -1382,7 +1378,6 @@ COperatorLine.prototype.calcCoord = function(stretch)
var XX = [], var XX = [],
YY = []; YY = [];
//var shY = 2*Y[1]*alpha;
var shY = 0; var shY = 0;
for(var i = 0; i < X.length; i++) for(var i = 0; i < X.length; i++)
...@@ -2959,9 +2954,7 @@ COperator.prototype.draw = function(x, y, pGraphics) ...@@ -2959,9 +2954,7 @@ COperator.prototype.draw = function(x, y, pGraphics)
} }
else else
{ {
var bLine = this.typeOper == ACCENT_LINE || this.typeOper == ACCENT_DOUBLE_LINE; if(this.IsLineGlyph())
if(bLine)
this.drawLines(x, y, pGraphics); this.drawLines(x, y, pGraphics);
else if(this.type === OPER_SEPARATOR) else if(this.type === OPER_SEPARATOR)
this.drawSeparator(x, y, pGraphics); this.drawSeparator(x, y, pGraphics);
...@@ -3020,6 +3013,10 @@ COperator.prototype.drawLines = function(absX, absY, pGraphics) ...@@ -3020,6 +3013,10 @@ COperator.prototype.drawLines = function(absX, absY, pGraphics)
this.operator.drawOnlyLines(PosOper.x + absX, PosOper.y + absY, pGraphics); this.operator.drawOnlyLines(PosOper.x + absX, PosOper.y + absY, pGraphics);
} }
} }
COperator.prototype.IsLineGlyph = function()
{
return this.typeOper == ACCENT_LINE || this.typeOper == ACCENT_DOUBLE_LINE;
}
COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch) COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch)
{ {
this.ParaMath = ParaMath; this.ParaMath = ParaMath;
...@@ -3039,6 +3036,8 @@ COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch) ...@@ -3039,6 +3036,8 @@ COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch)
oMeasure.SetFont(rPrp); oMeasure.SetFont(rPrp);
var bLine = this.IsLineGlyph();
var bTopBot = this.operator.loc == LOCATION_TOP || this.operator.loc == LOCATION_BOT; var bTopBot = this.operator.loc == LOCATION_TOP || this.operator.loc == LOCATION_BOT;
// Width // Width
...@@ -3049,7 +3048,13 @@ COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch) ...@@ -3049,7 +3048,13 @@ COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch)
} }
else else
{ {
if(bLine)
{
this.operator.fixSize(stretch);
width = this.operator.size.width;
}
else
{
var bNotStretchDelim = (this.type == OPER_DELIMITER || this.type == OPER_SEPARATOR) && this.grow == false; var bNotStretchDelim = (this.type == OPER_DELIMITER || this.type == OPER_SEPARATOR) && this.grow == false;
var StretchLng = bNotStretchDelim ? 0 : stretch; var StretchLng = bNotStretchDelim ? 0 : stretch;
...@@ -3060,6 +3065,7 @@ COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch) ...@@ -3060,6 +3065,7 @@ COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch)
width = bTopBot ? dims.Width : this.operator.size.width; width = bTopBot ? dims.Width : this.operator.size.width;
} }
}
// Height // Height
...@@ -3082,24 +3088,18 @@ COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch) ...@@ -3082,24 +3088,18 @@ COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch)
else else
{ {
if(bTopBot) if(bTopBot)
{
/*if(this.type == OPER_GROUP_CHAR)
height = letterOperator.size.height;
else
height = this.operator.size.height;*/
height = this.operator.size.height; height = this.operator.size.height;
}
else else
height = dims.Height; height = dims.Height;
} }
//height = bTopBot ? this.operator.size.height : dims.Height;
} }
// Ascent
var mgCtrPrp = this.Parent.Get_CompiledCtrPrp(); var mgCtrPrp = this.Parent.Get_CompiledCtrPrp();
var shCenter = this.Parent.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp); var shCenter = this.Parent.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp);
if(this.operator.loc == LOCATION_TOP || this.operator.loc == LOCATION_BOT) if(!bLine && (this.operator.loc == LOCATION_TOP || this.operator.loc == LOCATION_BOT))
ascent = dims.Height/2; ascent = dims.Height/2;
else else
ascent = height/2 + shCenter; ascent = height/2 + shCenter;
......
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