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

1. Убрала старую функции инициализации CAccent

2. Уменьшила высоту и ширину фигурной скобки для GroupCharacter. Ширина теперь для GroupCharacter статична, чтобы скобка не прыгала, как если бы это был Delimiter.
3. Реализовала круглую (в положении сверху и снизу) и квадратную скобки для GroupCharacter. 

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58392 954022d7-b5bf-4e40-9824-e11837661b57
parent d7eb7af4
...@@ -436,28 +436,6 @@ CSign.prototype.setPosition = function(pos) ...@@ -436,28 +436,6 @@ CSign.prototype.setPosition = function(pos)
{ {
this.sign.setPosition(pos); this.sign.setPosition(pos);
} }
/*CSign.prototype.setPosition = function(pos)
{
var shX = 0;
if(this.typeOper == ACCENT_GRAVE)
shX = 1.1*this.sign.size.widthG;
else if(this.typeOper == ACCENT_ACUTE)
shX = 1.25*this.sign.size.widthG;
else if(this.typeOper == ACCENT_ONE_DOT)
shX = 1.53*this.sign.size.widthG;
else if(this.typeOper == ACCENT_TWO_DOTS)
shX = 0.95*this.sign.size.widthG;
else if(this.typeOper == ACCENT_THREE_DOTS)
shX = 0.015*this.sign.size.widthG;
var position =
{
x: pos.x + shX,
y: pos.y + this.sign.size.ascent
};
this.sign.setPosition(position);
}*/
CSign.prototype.fixSize = function(oMeasure, stretch, bIncline) CSign.prototype.fixSize = function(oMeasure, stretch, bIncline)
{ {
var ctrPrp = this.Parent.Get_CompiledCtrPrp(); var ctrPrp = this.Parent.Get_CompiledCtrPrp();
...@@ -554,519 +532,6 @@ CAccent.prototype.IsAccent = function() ...@@ -554,519 +532,6 @@ CAccent.prototype.IsAccent = function()
{ {
return true; return true;
} }
CAccent.prototype.old_init = function(properties)
{
var type = properties.chrType,
code;
var typeOper, codeChr;
var operator;
//// ВРЕМЕННО !!!!
var bCode = false,
bType = typeof(type) !== "undefined" && type !== null;
if(typeof(properties.chr) === "string")
{
bCode = true;
code = properties.chr.charCodeAt(0);
}
/*var bDot = code === 0x307 || props.chr.type === ACCENT_ONE_DOT,
b2Dots = code === 0x308 || props.chr.type === ACCENT_TWO_DOTS,
b3Dots = code === 0x20DB || props.chr.type === ACCENT_THREE_DOTS,
bAccGrave = code === 0x300 || props.chr.type === ACCENT_GRAVE,
bAccAcute = code === 0x301 || props.chr.type === ACCENT_ACUTE;
if(bDot || b2Dots || b3Dots || bAccGrave || bAccAcute)
{
this.accent = new CMathText();
this.accent.add(code);
typeOper = props.chr.type;
}*/
if(code === 0x302 || type === ACCENT_CIRCUMFLEX)
{
typeOper = ACCENT_CIRCUMFLEX;
codeChr = 0x302;
operator = new CCircumflex();
var props =
{
turn: TURN_MIRROR_0
};
operator.init(props);
}
else if(code === 0x30C || type === ACCENT_COMB_CARON)
{
typeOper = ACCENT_COMB_CARON;
codeChr = 0x30C;
operator = new CCircumflex();
var props =
{
turn: TURN_0
};
operator.init(props);
}
else if(code === 0x305 || type === ACCENT_LINE)
{
typeOper = ACCENT_LINE;
//codeChr = 0x332;
codeChr = 0x305;
operator = new CLine();
}
else if(code === 0x33F || type === ACCENT_DOUBLE_LINE)
{
typeOper = ACCENT_DOUBLE_LINE;
//codeChr = 0x333;
codeChr = 0x33F;
operator = new CDoubleLine();
}
else if(code === 0x303 || type === ACCENT_TILDE)
{
typeOper = ACCENT_TILDE;
codeChr = 0x303;
operator = new CTilde();
}
else if(code === 0x306 || type === ACCENT_BREVE)
{
typeOper = ACCENT_BREVE;
codeChr = 0x306;
operator = new CBreve();
var props =
{
turn: TURN_MIRROR_0
};
operator.init(props);
}
else if(code == 0x311 || type == ACCENT_INVERT_BREVE)
{
typeOper = ACCENT_INVERT_BREVE;
codeChr = 0x311;
operator = new CBreve();
var props =
{
turn: TURN_0
};
operator.init(props);
}
else if(code === 0x20D6 || type === ACCENT_ARROW_LEFT)
{
typeOper = ACCENT_ARROW_LEFT;
codeChr = 0x20D6;
/*var glyph = new CCombiningArrow();
var props =
{
location: LOCATION_TOP,
turn: TURN_0
};
glyph.init(props);*/
operator = new COperator(OPER_ACCENT);
var props =
{
type: properties.chrType,
chr: properties.chr
};
var defaultProps =
{
loc: LOCATION_TOP
};
operator.init(props, defaultProps);
}
else if(code === 0x20D7 || type === ACCENT_ARROW_RIGHT)
{
typeOper = ACCENT_ARROW_RIGHT;
codeChr = 0x20D7;
/*var glyph = new CCombiningArrow();
var props =
{
location: LOCATION_TOP,
turn: TURN_180
};
glyph.init(props);
operator = new COperator(glyph);*/
operator = new COperator(OPER_ACCENT);
var props =
{
type: properties.chrType,
chr: properties.chr
};
var defaultProps =
{
loc: LOCATION_TOP
};
operator.init(props, defaultProps);
}
else if(code === 0x20E1 || type === ACCENT_ARROW_LR)
{
typeOper = ACCENT_ARROW_LR;
codeChr = 0x20E1;
/*var glyph = new CCombining_LR_Arrow();
var props =
{
location: LOCATION_TOP,
turn: TURN_0
};
glyph.init(props);
operator = new COperator(glyph);*/
operator = new COperator(OPER_ACCENT);
var props =
{
type: properties.chrType,
chr: properties.chr
};
var defaultProps =
{
loc: LOCATION_TOP
};
operator.init(props, defaultProps);
}
else if(code === 0x20D0 || type === ACCENT_HALF_ARROW_LEFT)
{
typeOper = ACCENT_HALF_ARROW_LEFT;
codeChr = 0x20D0;
/*var glyph = new CCombiningHalfArrow();
var props =
{
location: LOCATION_TOP,
turn: TURN_0
};
glyph.init(props);
operator = new COperator(glyph);*/
operator = new COperator(OPER_ACCENT);
var props =
{
type: properties.chrType,
chr: properties.chr
};
var defaultProps =
{
loc: LOCATION_TOP
};
operator.init(props, defaultProps);
}
else if(code === 0x20D1 || type === ACCENT_HALF_ARROW_RIGHT)
{
typeOper = ACCENT_HALF_ARROW_RIGHT;
codeChr = 0x20D1;
/*var glyph = new CCombiningHalfArrow();
var props =
{
location: LOCATION_TOP,
turn: TURN_180
};
glyph.init(props);
operator = new COperator(glyph);*/
operator = new COperator(OPER_ACCENT);
var props =
{
type: properties.chrType,
chr: properties.chr
};
var defaultProps =
{
loc: LOCATION_TOP
};
operator.init(props, defaultProps);
}
/*if(code === 0x302 || type === ACCENT_CIRCUMFLEX)
{
typeOper = ACCENT_CIRCUMFLEX;
this.code = 0x302;
accent = new CCircumflex();
accent.setTurn(TURN_0);
}
else if(code === 0x30C || type === ACCENT_COMB_CARON)
{
typeOper = ACCENT_COMB_CARON;
this.code = 0x30C;
accent = new CCircumflex();
accent.setTurn(TURN_MIRROR_0);
}
else if(code === 0x332 || type === ACCENT_LINE)
{
typeOper = ACCENT_LINE;
this.code = 0x332;
accent = new CLine();
}
else if(code === 0x333 || type === ACCENT_DOUBLE_LINE)
{
typeOper = ACCENT_DOUBLE_LINE;
this.code = 0x333;
accent = new CDoubleLine();
}
else if(code === 0x303 || type === ACCENT_TILDE)
{
typeOper = ACCENT_TILDE;
this.code = 0x303;
accent = new CTilde();
}
else if(code === 0x306 || type === ACCENT_BREVE)
{
typeOper = ACCENT_BREVE;
this.code = 0x306;
accent = new CBreve();
accent.setTurn(TURN_MIRROR_0);
}
else if(code == 0x311 || type == ACCENT_INVERT_BREVE)
{
typeOper = ACCENT_INVERT_BREVE;
this.code = 0x311;
accent = new CBreve();
accent.setTurn(TURN_0);
}
else if(code === 0x20D6 || type === ACCENT_ARROW_LEFT)
{
typeOper = ACCENT_ARROW_LEFT;
this.code = 0x20D6;
glyph = new CCombiningArrow();
var prp =
{
location: LOCATION_TOP,
turn: TURN_0
};
glyph.init(prp);
accent = new COperator(glyph);
}
else if(code === 0x20D7 || type === ACCENT_ARROW_RIGHT)
{
typeOper = ACCENT_ARROW_RIGHT;
this.code = 0x20D7;
glyph = new CCombiningArrow();
var prp =
{
location: LOCATION_TOP,
turn: TURN_180
};
glyph.init(prp);
accent = new COperator(glyph);
}
else if(code === 0x20E1 || type === ACCENT_ARROW_LR)
{
typeOper = ACCENT_ARROW_LR;
this.code = 0x20E1;
glyph = new CCombining_LR_Arrow();
var prp =
{
location: LOCATION_TOP,
turn: TURN_0
};
glyph.init(prp);
accent = new COperator(glyph);
}
else if(code === 0x20D0 || type === ACCENT_HALF_ARROW_LEFT)
{
typeOper = ACCENT_HALF_ARROW_LEFT;
this.code = 0x20D0;
glyph = new CCombiningHalfArrow();
var prp =
{
location: LOCATION_TOP,
turn: TURN_0
};
glyph.init(prp);
accent = new COperator(glyph);
}
else if(code === 0x20D1 || type === ACCENT_HALF_ARROW_RIGHT)
{
typeOper = ACCENT_HALF_ARROW_RIGHT;
this.code = 0x20D1;
glyph = new CCombiningHalfArrow();
var prp =
{
location: LOCATION_TOP,
turn: TURN_180
};
glyph.init(prp);
accent = new COperator(glyph);
}*/
///// group characters /////
/*else if(code === 0x2190 || type === ARROW_LEFT)
{
typeOper = ARROW_LEFT;
codeChr = 0x2190;
operator = new CSingleArrow();
var props =
{
location: this.loc,
turn: TURN_0
};
operator.init(props);
}
else if(code === 0x2192 || type === ARROW_RIGHT)
{
typeOper = ARROW_RIGHT;
codeChr = 0x2192;
glyph = new CSingleArrow();
var prp =
{
location: this.loc,
turn: TURN_180
};
glyph.init(prp);
}
else if(code === 0x2194 || type === ARROW_LR)
{
typeOper = ARROW_LR;
codeChr = 0x2194;
glyph = new CLeftRightArrow();
var prp =
{
location: this.loc,
turn: TURN_0
};
glyph.init(prp);
}
else if(code === 0x21D0 || type === DOUBLE_LEFT_ARROW)
{
typeOper = DOUBLE_LEFT_ARROW;
codeChr = 0x21D0;
glyph = new CDoubleArrow();
var prp =
{
location: this.loc,
turn: TURN_0
};
glyph.init(prp);
}
else if(code === 0x21D2 || type === DOUBLE_RIGHT_ARROW)
{
typeOper = DOUBLE_RIGHT_ARROW;
codeChr = 0x21D2;
glyph = new CDoubleArrow();
var prp =
{
location: this.loc,
turn: TURN_180
};
glyph.init(prp);
}
else if(code === 0x21D4 || type === DOUBLE_ARROW_LR)
{
typeOper = DOUBLE_ARROW_LR;
codeChr = 0x21D4;
glyph = new CLR_DoubleArrow();
var prp =
{
location: this.loc,
turn: TURN_0
};
glyph.init(prp);
}*/
/////
else if(bCode || bType)
{
typeOper = ACCENT_SIGN;
operator = new CSign();
var props =
{
type: type,
code: code
};
operator.init(props);
codeChr = operator.getCodeCharacter();
}
else
{
/*typeOper = ACCENT_COMB_CARON;
codeChr = 0x30C;
operator = new CCircumflex();
var props =
{
turn: TURN_MIRROR_0
};
operator.init(props);*/
typeOper = ACCENT_CIRCUMFLEX;
codeChr = 0x302;
operator = new CCircumflex();
var props =
{
turn: TURN_MIRROR_0
};
operator.init(props);
}
this.operator = operator;
this.operator.relate(this);
////
// TO DO
// убрать
//
this.typeOper = typeOper;
this.code = codeChr;
////
this.setDimension(1, 1);
this.setContent();
//this.setOperator(accent);
this.elements[0][0].SetDot(true);
}
CAccent.prototype.setPosition = function(pos, PosInfo) CAccent.prototype.setPosition = function(pos, PosInfo)
{ {
this.pos.x = pos.x; this.pos.x = pos.x;
...@@ -1134,7 +599,6 @@ CAccent.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize) ...@@ -1134,7 +599,6 @@ CAccent.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
this.operator.fixSize(ParaMath, oMeasure, base.size.width); this.operator.fixSize(ParaMath, oMeasure, base.size.width);
if(this.operator.typeOper == OPERATOR_TEXT) if(this.operator.typeOper == OPERATOR_TEXT)
{ {
var letterX = new CMathText(true); var letterX = new CMathText(true);
...@@ -1153,7 +617,6 @@ CAccent.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize) ...@@ -1153,7 +617,6 @@ CAccent.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
width += this.GapLeft + this.GapRight; width += this.GapLeft + this.GapRight;
this.size = {height: height, width: width, ascent: ascent}; this.size = {height: height, width: width, ascent: ascent};
} }
CAccent.prototype.getBase = function() CAccent.prototype.getBase = function()
......
...@@ -60,7 +60,6 @@ CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize) ...@@ -60,7 +60,6 @@ CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
this.Parent = Parent; this.Parent = Parent;
this.ParaMath = ParaMath; this.ParaMath = ParaMath;
//this.Set_CompiledCtrPrp(ParaMath);
if(this.RecalcInfo.bProps == true || RPI.bChangeInline == true) if(this.RecalcInfo.bProps == true || RPI.bChangeInline == true)
{ {
...@@ -125,8 +124,6 @@ CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize) ...@@ -125,8 +124,6 @@ CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
} }
else else
{ {
//this.setDistance();
this.FName.Resize(oMeasure, this, ParaMath, RPI, ArgSize); this.FName.Resize(oMeasure, this, ParaMath, RPI, ArgSize);
var ArgSzIter = ArgSize.Copy(); var ArgSzIter = ArgSize.Copy();
...@@ -150,28 +147,6 @@ CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize) ...@@ -150,28 +147,6 @@ CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
width += this.GapLeft + this.GapRight; width += this.GapLeft + this.GapRight;
/*var width = 0;
var height = 0;
var maxWH = this.getWidthsHeights();
this.setDistance();
var Widths = maxWH.widths;
var Heights = maxWH.heights;
for( var j = 0 ; j < this.nRow; j++ )
height += Heights[j];
height += this.dH*(this.nRow - 1);
for(var i=0; i < this.nCol ; i++)
width += Widths[i];
width += this.dW*(this.nCol - 1) + this.GapLeft + this.GapRight;
var ascent = this.getAscent(oMeasure);*/
this.size = {width: width, height: height, ascent: ascent}; this.size = {width: width, height: height, ascent: ascent};
} }
......
...@@ -93,6 +93,9 @@ var ACCENT_ARROW_RIGHT = 27; ...@@ -93,6 +93,9 @@ var ACCENT_ARROW_RIGHT = 27;
var ACCENT_ARROW_LR = 28; var ACCENT_ARROW_LR = 28;
var ACCENT_HALF_ARROW_LEFT = 29; var ACCENT_HALF_ARROW_LEFT = 29;
var ACCENT_HALF_ARROW_RIGHT = 30; var ACCENT_HALF_ARROW_RIGHT = 30;
var PARENTHESIS_TOP = 31;
var PARENTHESIS_BOTTOM = 32;
var BRACKET_SQUARE_TOP = 33;
var ACCENT_ONE_DOT = 31; var ACCENT_ONE_DOT = 31;
var ACCENT_TWO_DOTS = 32; var ACCENT_TWO_DOTS = 32;
......
...@@ -338,7 +338,6 @@ CGlyphOperator.prototype.getCoordinateGlyph = function() ...@@ -338,7 +338,6 @@ CGlyphOperator.prototype.getCoordinateGlyph = function()
}*/ }*/
/*var shW = 0, /*var shW = 0,
shH = 0; shH = 0;
...@@ -406,10 +405,6 @@ CGlyphOperator.prototype.relate = function(parent) ...@@ -406,10 +405,6 @@ CGlyphOperator.prototype.relate = function(parent)
{ {
this.Parent = parent; this.Parent = parent;
} }
CGlyphOperator.prototype.IsArrow = function()
{
return false;
}
function COperatorBracket() function COperatorBracket()
...@@ -421,8 +416,18 @@ COperatorBracket.prototype.calcSize = function( stretch ) ...@@ -421,8 +416,18 @@ COperatorBracket.prototype.calcSize = function( stretch )
{ {
var betta = this.getCtrPrp().FontSize/36; var betta = this.getCtrPrp().FontSize/36;
var heightBr, widthBr;
var minBoxH = 4.917529296874999 *betta; //width of 0x28
if(this.Parent.type == OPER_GROUP_CHAR)
{
// перевернутая скобка
widthBr = 7.347222222222221*betta;
heightBr = minBoxH;
}
else
{
// перевернутая скобка // перевернутая скобка
var minBoxH = 4.917529296874999 *betta, //width of 0x28
widthBr = 12.347222222222221*betta; widthBr = 12.347222222222221*betta;
var maxBoxH; var maxBoxH;
...@@ -439,8 +444,9 @@ COperatorBracket.prototype.calcSize = function( stretch ) ...@@ -439,8 +444,9 @@ COperatorBracket.prototype.calcSize = function( stretch )
var delta = maxBoxH - minBoxH; var delta = maxBoxH - minBoxH;
var heightBr = delta/4.3 * (rx - 1) + minBoxH; heightBr = delta/4.3 * (rx - 1) + minBoxH;
heightBr = heightBr > maxBoxH ? maxBoxH : heightBr; heightBr = heightBr > maxBoxH ? maxBoxH : heightBr;
}
return {width: widthBr, height: heightBr}; return {width: widthBr, height: heightBr};
} }
...@@ -848,13 +854,19 @@ COperatorBracket.prototype.calcCoord = function(stretch) ...@@ -848,13 +854,19 @@ COperatorBracket.prototype.calcCoord = function(stretch)
} }
var H = Y[53]*RX[53];
for(var i = 0; i < 54; i++) for(var i = 0; i < 54; i++)
{ {
YY[i] = (H - Y[i]*RX[i])*alpha; //YY[i] = (H - Y[i]*RX[i])*alpha;
if(this.Parent.type == OPER_GROUP_CHAR)
YY[i] = (Y[53] - Y[i])*alpha;
else
YY[i] = (Y[53]*RX[53] - Y[i]*RX[i])*alpha;
XX[i] = XX[i]*alpha; XX[i] = XX[i]*alpha;
} }
for(var i = 0; i < 50; i++) for(var i = 0; i < 50; i++)
YY[54 + i] = YY[51 - i]; YY[54 + i] = YY[51 - i];
...@@ -928,7 +940,6 @@ COperatorBracket.prototype.drawPath = function(pGraphics, XX, YY) ...@@ -928,7 +940,6 @@ COperatorBracket.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._c(XX[102], YY[102], XX[103], YY[103], XX[0], YY[0]); pGraphics._c(XX[102], YY[102], XX[103], YY[103], XX[0], YY[0]);
} }
// TODO: сделать так, чтобы размер скобки совпадал в начальном случае (плейсхолдер), сейчас по размеру аргумента
function COperatorParenthesis() function COperatorParenthesis()
{ {
...@@ -939,15 +950,29 @@ COperatorParenthesis.prototype.calcSize = function(stretch) ...@@ -939,15 +950,29 @@ COperatorParenthesis.prototype.calcSize = function(stretch)
{ {
var betta = this.getCtrPrp().FontSize/36; var betta = this.getCtrPrp().FontSize/36;
var maxBoxH = 9.63041992187 *betta, //9.63 width of 0x239D var heightBr, widthBr;
minBoxH = 5.27099609375 *betta, //width of 0x28 var minBoxH = 5.27099609375 *betta; //width of 0x28
if(this.Parent.type == OPER_GROUP_CHAR)
{
// перевернутая скобка
widthBr = 6.99444444444*betta;
heightBr = minBoxH;
}
else
{
var maxBoxH = 9.63041992187 *betta; //9.63 width of 0x239D
widthBr = 11.99444444444 *betta; widthBr = 11.99444444444 *betta;
var ry = stretch / widthBr, var ry = stretch / widthBr,
delta = maxBoxH - minBoxH; delta = maxBoxH - minBoxH;
var heightBr = delta/4.3 * (ry - 1) + minBoxH; heightBr = delta/4.3 * (ry - 1) + minBoxH;
heightBr = heightBr > maxBoxH ? maxBoxH : heightBr; heightBr = heightBr > maxBoxH ? maxBoxH : heightBr;
}
return {height: heightBr, width : widthBr}; return {height: heightBr, width : widthBr};
} }
...@@ -975,15 +1000,17 @@ COperatorParenthesis.prototype.calcCoord = function(stretch) ...@@ -975,15 +1000,17 @@ COperatorParenthesis.prototype.calcCoord = function(stretch)
var aug = stretch/(X[9]*alpha)/2; //Y[9]*alpha - высота скобки var aug = stretch/(X[9]*alpha)/2; //Y[9]*alpha - высота скобки
var RX, RY; var RX, RY;
var MIN_AUG = this.Parent.type == OPER_GROUP_CHAR ? 0.5 : 1;
if(aug > 6.53) if(aug > 6.53)
{ {
RX = 6.53; RX = 6.53;
RY = 2.05; RY = 2.05;
} }
else if(aug < 1) else if(aug < MIN_AUG)
{ {
RX = 1; RX = MIN_AUG;
RY = 1; RY = MIN_AUG;
} }
else else
{ {
...@@ -991,6 +1018,8 @@ COperatorParenthesis.prototype.calcCoord = function(stretch) ...@@ -991,6 +1018,8 @@ COperatorParenthesis.prototype.calcCoord = function(stretch)
RY = 1 + (aug - 1)*0.19; RY = 1 + (aug - 1)*0.19;
} }
if(this.Parent.type !== OPER_GROUP_CHAR)
{
var DistH = []; var DistH = [];
for(var i= 0; i< 5; i++) for(var i= 0; i< 5; i++)
DistH[i] = Y[9-i] - Y[i]; DistH[i] = Y[9-i] - Y[i];
...@@ -1000,6 +1029,7 @@ COperatorParenthesis.prototype.calcCoord = function(stretch) ...@@ -1000,6 +1029,7 @@ COperatorParenthesis.prototype.calcCoord = function(stretch)
Y[i] = Y[i]*RY; //точки правой дуги Y[i] = Y[i]*RY; //точки правой дуги
Y[9-i] = Y[i] - DistH[9-i]; //точки левой дуги Y[9-i] = Y[i] - DistH[9-i]; //точки левой дуги
} }
}
// X // X
var DistW = []; var DistW = [];
...@@ -1027,8 +1057,10 @@ COperatorParenthesis.prototype.calcCoord = function(stretch) ...@@ -1027,8 +1057,10 @@ COperatorParenthesis.prototype.calcCoord = function(stretch)
for(var i = 0; i < 10; i++) for(var i = 0; i < 10; i++)
{ {
YY[19 - i] = shiftY - Y[i]*alpha; YY[19 - i] = shiftY - Y[i]*alpha;
YY[i] = shiftY - Y[i]*alpha; YY[i] = shiftY - Y[i]*alpha;
XX[19 - i] = X[i]*alpha; XX[19 - i] = X[i]*alpha;
XX[i] = stretch - X[i]*alpha; XX[i] = stretch - X[i]*alpha;
} }
...@@ -1626,10 +1658,6 @@ CSingleArrow.prototype.drawPath = function(pGraphics, XX, YY) ...@@ -1626,10 +1658,6 @@ CSingleArrow.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._l(XX[9], YY[9]); pGraphics._l(XX[9], YY[9]);
pGraphics._l(XX[10], YY[10]); pGraphics._l(XX[10], YY[10]);
} }
CSingleArrow.prototype.IsArrow = function()
{
return true;
}
function CLeftRightArrow() function CLeftRightArrow()
{ {
...@@ -1715,10 +1743,6 @@ CLeftRightArrow.prototype.drawPath = function(pGraphics, XX, YY) ...@@ -1715,10 +1743,6 @@ CLeftRightArrow.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._l(XX[16], YY[16]); pGraphics._l(XX[16], YY[16]);
} }
CLeftRightArrow.prototype.IsArrow = function()
{
return true;
}
function CDoubleArrow() function CDoubleArrow()
{ {
...@@ -1814,10 +1838,7 @@ CDoubleArrow.prototype.drawPath = function(pGraphics, XX, YY) ...@@ -1814,10 +1838,7 @@ CDoubleArrow.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._m(XX[16], YY[16]); pGraphics._m(XX[16], YY[16]);
pGraphics._l(XX[17], YY[17]); pGraphics._l(XX[17], YY[17]);
} }
CDoubleArrow.prototype.IsArrow = function()
{
return true;
}
function CLR_DoubleArrow() function CLR_DoubleArrow()
{ {
...@@ -1923,11 +1944,6 @@ CLR_DoubleArrow.prototype.drawPath = function(pGraphics, XX, YY) ...@@ -1923,11 +1944,6 @@ CLR_DoubleArrow.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._l(XX[22], YY[22]); pGraphics._l(XX[22], YY[22]);
pGraphics._l(XX[23], YY[23]); pGraphics._l(XX[23], YY[23]);
} }
CLR_DoubleArrow.prototype.IsArrow = function()
{
return true;
}
function CCombiningArrow() function CCombiningArrow()
...@@ -2749,6 +2765,45 @@ COperator.prototype.mergeProperties = function(properties, defaultProps) // pr ...@@ -2749,6 +2765,45 @@ COperator.prototype.mergeProperties = function(properties, defaultProps) // pr
}; };
operator.init(prp); operator.init(prp);
} }
else if(code === 0x23DC || type === PARENTHESIS_TOP)
{
codeChr = 0x23DC;
typeOper = PARENTHESIS_TOP;
operator = new COperatorParenthesis();
prp =
{
location: location,
turn: TURN_0
};
operator.init(prp);
}
else if(code === 0x23DD || type === PARENTHESIS_BOTTOM)
{
codeChr = 0x23DD;
typeOper = PARENTHESIS_BOTTOM;
operator = new COperatorParenthesis();
prp =
{
location: location,
turn: TURN_MIRROR_0
};
operator.init(prp);
}
else if(code === 0x23E0 || type === BRACKET_SQUARE_TOP)
{
codeChr = 0x23E0;
typeOper = BRACKET_SQUARE_TOP;
operator = new CSquareBracket();
prp =
{
location: location,
turn: TURN_0
};
operator.init(prp);
}
else if(code === 0x2190 || type === ARROW_LEFT) else if(code === 0x2190 || type === ARROW_LEFT)
{ {
codeChr = 0x2190; codeChr = 0x2190;
...@@ -3235,7 +3290,13 @@ COperator.prototype.getChr = function() ...@@ -3235,7 +3290,13 @@ COperator.prototype.getChr = function()
} }
COperator.prototype.IsArrow = function() COperator.prototype.IsArrow = function()
{ {
return this.operator.IsArrow(); //return this.operator.IsArrow();
var bArrow = this.typeOper == ARROW_LEFT || this.typeOper == ARROW_RIGHT || this.typeOper == ARROW_LR,
bDoubleArrow = this.typeOper == DOUBLE_LEFT_ARROW || this.typeOper == DOUBLE_RIGHT_ARROW || this.typeOper == DOUBLE_ARROW_LR,
bAccentArrow = his.typeOper == ACCENT_ARROW_LEFT || this.typeOper == ACCENT_ARROW_RIGHT || this.typeOper == ACCENT_ARROW_LR || this.typeOper == ACCENT_HALF_ARROW_LEFT || this.typeOper == ACCENT_HALF_ARROW_RIGHT;
return bArrow || bDoubleArrow;
} }
function CDelimiter(props) function CDelimiter(props)
......
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