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

Свойства по формату : accent, delimiters, borderBox, bar, box, fraction,...

Свойства по формату : accent, delimiters, borderBox, bar, box, fraction, limit, nary, GroupCharacter

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56373 954022d7-b5bf-4e40-9824-e11837661b57
parent d89942bb
......@@ -786,13 +786,13 @@ ParaMath.prototype =
if(argSize == -1)
{
//FSize = 0.0009*FSize*FSize + 0.68*FSize + 0.26;
FSize = 0.77*FSize;
FSize = 0.76*FSize;
}
else if(argSize == -2)
{
//FSize = -0.0004*FSize*FSize + 0.66*FSize + 0.87;
FSize = 0.77*0.77*FSize;
FSize = 0.76*0.855*FSize;
}
tPrp.FontSize = FSize;
......
......@@ -1640,8 +1640,8 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure)
this.operator.setProperties(prp, defaultPrp);
this.chr = String.fromCharCode(this.operator.code);
this.chrType = this.operator.typeOper;
this.Pr.chr = String.fromCharCode(this.operator.code);
this.Pr.chrType = this.operator.typeOper;
}
this.operator.relate(this);
......
......@@ -976,7 +976,7 @@ CMathBase.prototype =
width += this.dW*(this.nCol - 1);
width += this.GapLeft + this.GapRight;
var ascent = this.getAscent(height, oMeasure);
var ascent = this.getAscent(oMeasure, height);
this.size = {width: width, height: height, ascent: ascent};
},
......@@ -994,7 +994,7 @@ CMathBase.prototype =
{
this.Set_CompiledCtrPrp();
this.RecalcInfo.bCtrPrp = false;
this.RecalcInfo.bProps = false;
//this.RecalcInfo.bProps = false;
}
for(var i=0; i < this.nRow; i++)
......@@ -1017,12 +1017,12 @@ CMathBase.prototype =
return res;
},
getAscent: function(_height, oMeasure)
getAscent: function(oMeasure, _height)
{
var Ascent = 0;
if(this.nRow > 1)
{
Ascent = _height || this.size.height;
Ascent = _height;
Ascent /=2;
var MergedCtrPrp = this.Get_CompiledCtrPrp();
Ascent += this.ParaMath.GetShiftCenter(oMeasure, MergedCtrPrp);
......
......@@ -22,10 +22,10 @@ function CBorderBox(props)
hideRight: false,
hideTop: false,
hideBot: false,
strikeBLTR: true,
strikeTLBR: true,
strikeH: true,
strikeV: true
strikeBLTR: false,
strikeTLBR: false,
strikeH: false,
strikeV: false
};
CMathBase.call(this);
......@@ -62,35 +62,36 @@ CBorderBox.prototype.init = function(props)
}*/
this.setBorders(props);
this.setDimension(1, 1);
this.setDimension(1, 1);
this.setContent();
}
CBorderBox.prototype.setBorders = function(props)
{
if(typeof(props) !== "undefined" && props !== null)
{
if(typeof(this.Pr.hideLeft) !== "undefined" && this.Pr.hideLeft !== null)
if(typeof(props.hideLeft) !== "undefined" && props.hideLeft !== null)
this.Pr.hideLeft = props.hideLeft;
if(typeof(this.Pr.hideRight) !== "undefined" && this.Pr.hideRight !== null)
if(typeof(props.hideRight) !== "undefined" && props.hideRight !== null)
this.Pr.hideRight = props.hideRight;
if(typeof(this.Pr.hideTop) !== "undefined" && this.Pr.hideTop !== null)
if(typeof(props.hideTop) !== "undefined" && props.hideTop !== null)
this.Pr.hideTop = props.hideTop;
if(typeof(this.Pr.hideBot) !== "undefined" && this.Pr.hideBot !== null)
if(typeof(props.hideBot) !== "undefined" && props.hideBot !== null)
this.Pr.hideBot = props.hideBot;
if(typeof(this.Pr.strikeBLTR) !== "undefined" && this.Pr.strikeBLTR !== null) // right diagonal
if(typeof(props.strikeBLTR) !== "undefined" && props.strikeBLTR !== null) // right diagonal
this.Pr.strikeBLTR = props.strikeBLTR;
if(typeof(this.Pr.strikeTLBR) !== "undefined" && this.Pr.strikeTLBR !== null) // left diagonal
if(typeof(props.strikeTLBR) !== "undefined" && props.strikeTLBR !== null) // left diagonal
this.Pr.strikeTLBR = props.strikeTLBR;
if(typeof(this.Pr.strikeH) !== "undefined" && this.Pr.strikeH !== null)
if(typeof(props.strikeH) !== "undefined" && props.strikeH !== null)
this.Pr.strikeH = props.strikeH;
if(typeof(this.Pr.strikeV) !== "undefined" && this.Pr.strikeV !== null)
if(typeof(props.strikeV) !== "undefined" && props.strikeV !== null)
this.Pr.strikeV = props.strikeV;
}
......@@ -129,7 +130,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
//var penW = this.Get_CompiledCtrPrp().FontSize* 25.4/72 * 0.06 ;
var penW = this.Get_CompiledCtrPrp().FontSize*0.02;
if(this.Pr.hideTop == false)
if(!this.Pr.hideTop)
{
var x1 = this.pos.x + x,
x2 = this.pos.x + x + this.size.width - penW/2,
......@@ -145,7 +146,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
pGraphics.drawHorLine(0, y1 + penW, x1 + 2*25.4/96, x2 , 25.4/96);*/
}
if(this.Pr.hideBot == false)
if(!this.Pr.hideBot)
{
var x1 = this.pos.x + x,
x2 = this.pos.x + x + this.size.width - penW/2,
......@@ -155,7 +156,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
pGraphics.drawHorLine(0, y1, x1, x2, penW);
}
if(this.Pr.hideLeft == false)
if(!this.Pr.hideLeft)
{
var x1 = this.pos.x + x,
y1 = this.pos.y + y,
......@@ -165,7 +166,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
pGraphics.drawVerLine(0, x1, y1, y2, penW);
}
if(this.Pr.hideRight == false)
if(!this.Pr.hideRight)
{
var x1 = this.pos.x + x + this.size.width - penW/2,
y1 = this.pos.y + y,
......@@ -227,7 +228,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
}
if(this.bHor)
if(this.Pr.strikeH)
{
var x1 = this.pos.x + x,
x2 = this.pos.x + x + this.size.width - penW,
......@@ -237,7 +238,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
pGraphics.drawHorLine(0, y1, x1, x2, penW);
}
if(this.bVert)
if(this.Pr.strikeV)
{
var x1 = this.pos.x + x + this.size.width/2 - penW/2,
y1 = this.pos.y + y,
......@@ -247,6 +248,135 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
pGraphics.drawVerLine(0, x1, y1, y2, penW);
}
}
CBorderBox.prototype.old_draw = function(x, y, pGraphics)
{
this.elements[0][0].draw(x, y, pGraphics);
//var penW = this.getCtrPrp().FontSize* 25.4/96 * 0.08 ;
var penW = this.Get_CompiledCtrPrp().FontSize*0.02;
if(!this.Pr.hideTop)
{
var x1 = this.pos.x + x,
//x2 = this.pos.x + x + this.size.width - 25.4/96,
x2 = this.pos.x + x + this.size.width - penW,
y1 = this.pos.y + y;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawHorLine(0, y1, x1, x2, penW);
}
if(!this.Pr.hideBot)
{
var x1 = this.pos.x + x,
//x2 = this.pos.x + x + this.size.width - 25.4/96,
x2 = this.pos.x + x + this.size.width - penW,
y1 = this.pos.y + y + this.size.height - penW;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawHorLine(0, y1, x1, x2, penW);
}
if(!this.Pr.hideLeft)
{
var x1 = this.pos.x + x,
y1 = this.pos.y + y,
y2 = this.pos.y + y + this.size.height - penW;
//y2 = this.pos.y + y + this.size.height - 25.4/96;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawVerLine(0, x1, y1, y2, penW);
}
if(!this.Pr.hideRight)
{
var x1 = this.pos.x + x + this.size.width - penW,
y1 = this.pos.y + y,
y2 = this.pos.y + y + this.size.height - penW;
//y2 = this.pos.y + y + this.size.height - 25.4/96 ;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawVerLine(0, x1, y1, y2, penW);
}
if(this.Pr.strikeTLBR)
{
var pW = penW*0.8;
var x1 = this.pos.x + x , y1 = this.pos.y + y,
x2 = x1 + pW, y2 = y1,
//x3 = x1 + this.size.width - 25.4/96, y3 = y1 + this.size.height - pW - 25.4/96,
x3 = x1 + this.size.width - penW, y3 = y1 + this.size.height - pW - penW,
x4 = x3, y4 = y3 + pW,
x5 = x4 - pW, y5 = y4,
x6 = x1, y6 = y1 + pW,
x7 = x1, y7 = y1;
pGraphics.p_width(1000);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
pGraphics._m(x1, y1);
pGraphics._l(x2, y2);
pGraphics._l(x3, y3);
pGraphics._l(x4, y4);
pGraphics._l(x5, y5);
pGraphics._l(x6, y6);
pGraphics._l(x7, y7);
pGraphics.df();
}
if(this.Pr.strikeBLTR)
{
var pW = penW*0.8;
var x1 = this.pos.x + x + this.size.width - pW - penW, y1 = this.pos.y + y,
//x1 = this.pos.x + x + this.size.width - pW - 25.4/96, y1 = this.pos.y + y,
x2 = x1 + pW, y2 = y1,
x3 = x2, y3 = y2 + pW,
x4 = this.pos.x + x + pW, y4 = this.pos.y + y + this.size.height - penW,
//x4 = this.pos.x + x + pW, y4 = this.pos.y + y + this.size.height - 25.4/96,
x5 = x4 - pW, y5 = y4,
x6 = x5, y6 = y5 - pW,
x7 = x1, y7 = y1;
pGraphics.p_width(1000);
pGraphics.b_color1(0,0,0, 255);
pGraphics._s();
pGraphics._m(x1, y1);
pGraphics._l(x2, y2);
pGraphics._l(x3, y3);
pGraphics._l(x4, y4);
pGraphics._l(x5, y5);
pGraphics._l(x6, y6);
pGraphics._l(x7, y7);
pGraphics.df();
}
if(this.Pr.strikeH)
{
var x1 = this.pos.x + x,
x2 = this.pos.x + x + this.size.width - penW,
//x2 = this.pos.x + x + this.size.width - 25.4/96,
y1 = this.pos.y + y + this.size.height/2 - penW/2;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawHorLine(0, y1, x1, x2, penW);
}
if(this.Pr.strikeV)
{
var x1 = this.pos.x + x + this.size.width/2 - penW/2,
y1 = this.pos.y + y,
y2 = this.pos.y + y + this.size.height - penW;
//y2 = this.pos.y + y + this.size.height - 25.4/96;
pGraphics.p_color(0,0,0, 255);
pGraphics.drawVerLine(0, x1, y1, y2, penW);
}
}
CBorderBox.prototype.setPosition = function(pos)
{
......@@ -594,6 +724,20 @@ CBar.prototype.init = function(props)
else if(props.pos === LOCATION_BOT || props.location === LOCATION_BOT)
this.Pr.pos = LOCATION_BOT;
var prp =
{
loc: this.Pr.pos,
type: DELIMITER_LINE
};
var defaultProps =
{
loc: LOCATION_BOT
};
this.setCharacter(prp, defaultProps);
if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined")
this.setCtrPrp(props.ctrPrp);
}
......@@ -602,14 +746,8 @@ CBar.prototype.setLocation = function(pos)
this.Pr.pos = pos;
this.RecalcInfo.bProps = true;
}
CBar.prototype.Resize = function()
CBar.prototype.Resize = function(Parent, ParaMath, oMeasure)
{
if(this.RecalcInfo.bCtrPrp == true)
{
this.Set_CompiledCtrPrp();
this.RecalcInfo.bCtrPrp = false;
}
if(this.RecalcInfo.bProps == true)
{
var prp =
......@@ -624,9 +762,10 @@ CBar.prototype.Resize = function()
};
this.setCharacter(prp, defaultProps);
this.RecalcInfo.bProps = false;
}
CBar.superclass.Resize.call(this);
CBar.superclass.Resize.call(this, Parent, ParaMath, oMeasure);
}
CBar.prototype.getAscent = function()
{
......
......@@ -3,7 +3,12 @@ function CFraction(props)
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_FRACTION;
this.type = BAR_FRACTION;
this.Pr =
{
type: BAR_FRACTION
};
//this.type = BAR_FRACTION;
this.bHideBar = false;
CMathBase.call(this);
......@@ -31,10 +36,10 @@ CFraction.prototype.setType = function(type)
bLin = type === LINEAR_FRACTION;
if(bBar || bSkew || bLin) // на всякий случай
this.type = props.type;
this.Pr.type = type;
}
if(this.type == BAR_FRACTION || this.type == NO_BAR_FRACTION)
if(this.Pr.type == BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION)
{
var num = new CNumerator();
......@@ -42,17 +47,17 @@ CFraction.prototype.setType = function(type)
this.setDimension(2, 1);
if(this.type == NO_BAR_FRACTION)
if(this.Pr.type == NO_BAR_FRACTION)
this.bHideBar = true;
this.addMCToContent(num, den);
}
else if(this.type == SKEWED_FRACTION)
else if(this.Pr.type == SKEWED_FRACTION)
{
this.setDimension(1, 2);
this.setContent();
}
else if(this.type == LINEAR_FRACTION)
else if(this.Pr.type == LINEAR_FRACTION)
{
this.setDimension(1, 2);
this.setContent();
......@@ -60,15 +65,15 @@ CFraction.prototype.setType = function(type)
}
CFraction.prototype.getType = function()
{
return this.type;
return this.Pr.type;
}
CFraction.prototype.draw = function(x, y, pGraphics)
{
if(this.type == BAR_FRACTION || this.type == NO_BAR_FRACTION)
if(this.Pr.type == BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION)
this.drawBarFraction(x, y, pGraphics);
else if(this.type == SKEWED_FRACTION)
else if(this.Pr.type == SKEWED_FRACTION)
this.drawSkewedFraction(x, y, pGraphics);
else if(this.type == LINEAR_FRACTION)
else if(this.Pr.type == LINEAR_FRACTION)
this.drawLinearFraction(x, y, pGraphics);
}
CFraction.prototype.drawBarFraction = function(x, y, pGraphics)
......@@ -234,7 +239,7 @@ CFraction.prototype.getNumerator = function()
{
var numerator;
if(this.type == BAR_FRACTION || this.type == NO_BAR_FRACTION)
if(this.Pr.type == BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION)
numerator = this.elements[0][0].getElement();
else
numerator = this.elements[0][0];
......@@ -245,7 +250,7 @@ CFraction.prototype.getDenominator = function()
{
var denominator;
if(this.type == BAR_FRACTION || this.type == NO_BAR_FRACTION)
if(this.Pr.type == BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION)
denominator = this.elements[1][0].getElement();
else
denominator = this.elements[0][1];
......@@ -254,11 +259,11 @@ CFraction.prototype.getDenominator = function()
}
CFraction.prototype.recalculateSize = function(oMeasure)
{
if(this.type == BAR_FRACTION || this.type == NO_BAR_FRACTION)
if(this.Pr.type == BAR_FRACTION || this.Pr.type == NO_BAR_FRACTION)
this.recalculateBarFraction(oMeasure);
else if(this.type == SKEWED_FRACTION)
else if(this.Pr.type == SKEWED_FRACTION)
this.recalculateSkewed(oMeasure);
else if(this.type == LINEAR_FRACTION)
else if(this.Pr.type == LINEAR_FRACTION)
this.recalculateLinear(oMeasure);
}
CFraction.prototype.recalculateBarFraction = function(oMeasure)
......@@ -330,7 +335,7 @@ CFraction.prototype.recalculateLinear = function()
}
CFraction.prototype.setPosition = function(pos)
{
if(this.type == SKEWED_FRACTION)
if(this.Pr.type == SKEWED_FRACTION)
{
this.pos = {x: pos.x, y: pos.y - this.size.ascent};
......@@ -351,7 +356,7 @@ CFraction.prototype.findDisposition = function( mCoord )
{
var disposition;
if(this.type == SKEWED_FRACTION)
if(this.Pr.type == SKEWED_FRACTION)
{
var mouseCoord = {x: mCoord.x, y: mCoord.y},
posCurs = {x: null, y: null},
......@@ -416,11 +421,7 @@ CFraction.prototype.findDisposition = function( mCoord )
}
CFraction.prototype.getPropsForWrite = function()
{
var props = {
type: this.type
};
return props;
return this.Pr;
}
CFraction.prototype.Save_Changes = function(Data, Writer)
......
function CLimit(props)
{
this.Id = g_oIdCounter.Get_NewId(); this.kind = MATH_LIMIT;
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_LIMIT;
this.Pr =
{
type: LIMIT_LOW
};
this.type = LIMIT_LOW;
CMathBase.call(this);
if(props.type === LIMIT_UP || props.type === LIMIT_LOW)
this.type = props.type;
this.Pr.type = props.type;
this.setDimension(2, 1);
......@@ -15,24 +21,22 @@ function CLimit(props)
var oIter = new CMathContent();
oIter.decreaseArgSize();
if(this.type == LIMIT_LOW)
if(this.Pr.type == LIMIT_LOW)
this.addMCToContent(oBase, oIter);
else if(this.type == LIMIT_UP)
else if(this.Pr.type == LIMIT_UP)
this.addMCToContent(oIter, oBase);
this.setCtrPrp(props.ctrPrp);
/// вызов этой функции обязательно в конце
//this.WriteContentsToHistory();
g_oTableId.Add( this, this.Id );
}
extend(CLimit, CMathBase);
CLimit.prototype.getAscent = function()
{
var ascent;
if(this.type == LIMIT_LOW)
if(this.Pr.type == LIMIT_LOW)
ascent = this.elements[0][0].size.ascent;
else if(this.type == LIMIT_UP)
else if(this.Pr.type == LIMIT_UP)
ascent = this.elements[0][0].size.height + this.dH + this.elements[1][0].size.ascent;
return ascent;
......@@ -40,9 +44,9 @@ CLimit.prototype.getAscent = function()
CLimit.prototype.getFName = function()
{
var fName;
if(this.type == LIMIT_LOW)
if(this.Pr.type == LIMIT_LOW)
fName = this.elements[0][0];
else if(this.type == LIMIT_UP)
else if(this.Pr.type == LIMIT_UP)
fName = this.elements[1][0];
return fName;
......@@ -50,9 +54,9 @@ CLimit.prototype.getFName = function()
CLimit.prototype.getIterator = function()
{
var iterator;
if(this.type == LIMIT_LOW)
if(this.Pr.type == LIMIT_LOW)
iterator = this.elements[1][0];
else if(this.type == LIMIT_UP)
else if(this.Pr.type == LIMIT_UP)
iterator = this.elements[0][0];
return iterator;
......@@ -63,12 +67,7 @@ CLimit.prototype.setDistance = function()
}
CLimit.prototype.getPropsForWrite = function()
{
var props =
{
type: this.type
};
return props;
return this.Pr;
}
CLimit.prototype.Save_Changes = function(Data, Writer)
{
......@@ -106,10 +105,14 @@ CLimit.prototype.Get_Id = function()
{
return this.Id;
}
function CMathFunc(props)
{
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_FUNCTION;
this.Pr = {};
CMathBase.call(this);
this.setDimension(1, 2);
......@@ -117,8 +120,6 @@ function CMathFunc(props)
this.setCtrPrp(props.ctrPrp);
/// вызов этой функции обязательно в конце
//this.WriteContentsToHistory();
g_oTableId.Add( this, this.Id );
}
extend(CMathFunc, CMathBase);
......
......@@ -5103,7 +5103,8 @@ CMathContent.prototype =
{
if(!this.bRoot)
{
var oWPrp = this.Parent.Get_CtrPrp();
//var oWPrp = this.Parent.Get_CtrPrp();
var oWPrp = this.Parent.Get_CompiledCtrPrp();
//this.applyArgSize(oWPrp);
this.ParaMath.ApplyArgSize(oWPrp, this.argSize);
......@@ -5242,7 +5243,8 @@ CMathContent.prototype =
{
pGraphics.b_color1(0,0,0,255);
var oWPrp = this.Parent.Get_CtrPrp();
//var oWPrp = this.Parent.Get_CtrPrp();
var oWPrp = this.Parent.Get_CompiledCtrPrp();
//this.applyArgSize(oWPrp);
this.ParaMath.ApplyArgSize(oWPrp, this.argSize);
......@@ -6289,7 +6291,7 @@ CMathContent.prototype =
var TextPr;
if(this.IsPlaceholder())
TextPr = this.Parent.getCtrPrp();
TextPr = this.Parent.Get_CtrPrp();
else
TextPr = this.content[pos].Get_TextPr(ContentPos, Depth + 1);
......@@ -6301,7 +6303,7 @@ CMathContent.prototype =
if(this.IsPlaceholder())
{
TextPr = this.Parent.getCtrPrp();
TextPr = this.Parent.Get_CompiledCtrPrp();
}
else if ( true === this.bSelectionUse || bAll == true)
{
......
......@@ -11,6 +11,8 @@
var DIV_CENT = 0.1386;
var StartTextElement = 0x2B1A; // Cambria Math
// TODO
......@@ -279,6 +281,8 @@ CMathText.prototype =
var X = this.pos.x + x,
Y = this.pos.y + y;
//console.log(String.fromCharCode(this.getCode()) + ": X " + X);
/*var tx = 0;
var ty = 0;
......
......@@ -202,6 +202,3 @@ var extend = function(Child, Parent)
Child.superclass = Parent.prototype;
}
// default Txt Prp
// argSize
//величина символа "сигма" не меняется в зависимости от аргумента
//если не выставлено в настройках
/////////////////////****//////////////////////////
// IterType:
// 0 - без итераторов
// 1 - итератор сверху
// 2 - итератор снизу
// 3 - оба итератора
// OrderType
// 0 - итраторы по прямой линии
// 1 - итераторы расположены также, как у степени
function CNary(props)
{
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_NARY;
this.type = null;
this.code = null; // for "read"
this.grow = false;
this.supHide = false;
this.subHide = false;
this.Pr =
{
chr: null,
chrType: NARY_INTEGRAL,
supHide: false,
subHide: false,
grow: false,
limLoc: null
};
//this.limLoc = null;
//this.type = null;
//this.code = null; // for "read"
//this.grow = false;
//this.supHide = false;
//this.subHide = false;
CMathBase.call(this);
this.init(props);
this.setCtrPrp(props.ctrPrp);
//this.setCtrPrp(props.ctrPrp);
g_oTableId.Add( this, this.Id );
}
extend(CNary, CMathBase);
CNary.prototype.init = function(props)
{
if(props.ctrPrp !== null && typeof(props.ctrPrp)!== "undefined")
this.setCtrPrp(props.ctrPrp);
if(props.supHide === true || props.supHide === 1)
this.supHide = true;
this.Pr.supHide = true;
if(props.subHide === true || props.subHide === 1)
this.subHide = true;
this.Pr.subHide = true;
if(props.grow === true || props.grow === 1)
this.grow = true;
this.Pr.grow = true;
this.setDimension(1, 2);
var signCode, sign;
var bChr = false;
var oSign = this.getSign(props.chr, props.signType);
if(typeof(props.chr) === "string")
{
signCode = props.chr.charCodeAt(0);
bChr = true;
}
//this.Pr.chrType = oSign.chrType;
//this.Pr.chr = String.fromCharCode(oSign.chrCode);
this.Pr.chrType = props.chrType;
this.Pr.chr = props.chr;
if(props.limLoc == NARY_UndOvr)
this.limLoc = NARY_UndOvr;
this.Pr.limLoc = NARY_UndOvr;
else if(props.limLoc == NARY_SubSup)
this.limLoc = NARY_SubSup;
this.Pr.limLoc = NARY_SubSup;
else
{
var bIntegral = signCode > 0x222A && signCode < 0x2231;
var bIntegral = oSign.chrCode > 0x222A && oSign.chrCode < 0x2231;
//var MPrp = this.Parent.Composition.GetMathPr();
if(bIntegral)
this.limLoc = g_oMathSettings.intLim;
this.Pr.limLoc = g_oMathSettings.intLim;
else
this.limLoc = g_oMathSettings.naryLim;
this.Pr.limLoc = g_oMathSettings.naryLim;
}
var arg = new CMathContent(),
base;
if(signCode == 0x222B || props.signType == NARY_INTEGRAL)
if(this.Pr.limLoc === NARY_UndOvr)
{
this.code = 0x222B;
this.type = NARY_INTEGRAL;
sign = new CIntegral();
if(this.Pr.supHide && this.Pr.subHide)
{
base = oSign.operator;
}
else if(signCode == 0x222C || props.signType == NARY_DOUBLE_INTEGRAL)
else if( this.Pr.supHide && !this.Pr.subHide )
{
this.code = 0x222C;
this.type = NARY_DOUBLE_INTEGRAL;
sign = new CDoubleIntegral();
base = new CNaryOvr();
base.init(oSign.operator);
base.setCtrPrp(this.CtrPrp.Copy());
}
else if(signCode == 0x222D || props.signType == NARY_TRIPLE_INTEGRAL)
else if( !this.Pr.supHide && this.Pr.subHide )
{
this.code = 0x222D;
this.type = NARY_TRIPLE_INTEGRAL;
sign = new CTripleIntegral();
base = new CNaryUnd();
base.init(oSign.operator);
base.setCtrPrp(this.CtrPrp.Copy());
}
else if(signCode == 0x222E || props.signType == NARY_CONTOUR_INTEGRAL )
else
{
this.code = 0x222E;
this.type = NARY_CONTOUR_INTEGRAL;
sign = new CContourIntegral();
base = new CNaryUndOvr();
base.init(oSign.operator);
base.setCtrPrp(this.CtrPrp.Copy());
}
else if(signCode == 0x222F || props.signType == NARY_SURFACE_INTEGRAL )
}
else
{
this.code = 0x222F;
this.type = NARY_SURFACE_INTEGRAL;
sign = new CSurfaceIntegral();
if( this.Pr.supHide && !this.Pr.subHide )
{
var prp = {type: DEGREE_SUBSCRIPT, indef: 2, oBase: oSign.operator, ctrPrp: this.CtrPrp.Copy() };
base = new CDegree(prp);
}
else if(signCode == 0x2230 || props.signType == NARY_VOLUME_INTEGRAL)
else if( !this.Pr.supHide && this.Pr.subHide )
{
this.code = 0x2230;
this.type = NARY_VOLUME_INTEGRAL;
sign = new CVolumeIntegral();
var prp = {type: DEGREE_SUPERSCRIPT, indef: 2, oBase: oSign.operator, ctrPrp: this.CtrPrp.Copy()};
base = new CDegree(prp);
}
else if(signCode == 0x2211 || props.signType == NARY_SIGMA)
else
{
this.code = 0x2211;
this.type = NARY_SIGMA;
sign = new CSigma();
var prp = {type: DEGREE_SubSup, indef: 2, oBase: oSign.operator, ctrPrp: this.CtrPrp.Copy()};
base = new CDegreeSubSup(prp);
}
else if(signCode == 0x220F || props.signType == NARY_PRODUCT)
}
this.addMCToContent(base, arg);
}
CNary.prototype.Resize = function(Parent, ParaMath, oMeasure)
{
if(this.RecalcInfo.bProps)
{
this.code = 0x220F;
this.type = NARY_PRODUCT;
sign = new CProduct();
var oSign = this.getSign(this.Pr.chr, this.Pr.chrType);
this.Pr.chrType = oSign.chrType;
this.Pr.chr = String.fromCharCode(oSign.chrCode);
}
else if(signCode == 0x2210 || props.signType == NARY_COPRODUCT)
CNary.superclass.Resize.call(this, Parent, ParaMath, oMeasure);
}
CNary.prototype.getSign = function(chr, chrType)
{
var result =
{
this.code = 0x2210;
this.type = NARY_COPRODUCT;
sign = new CProduct(-1);
chrCode: null,
chrType: null,
operator: null
}
else if(signCode == 0x22C3 || props.signType == NARY_UNION)
var bChr = false;
var chrCode;
if(typeof(chr) === "string")
{
this.code = 0x22C3;
this.type = NARY_UNION;
sign = new CUnion();
chrCode = chr.charCodeAt(0);
bChr = true;
}
else if(signCode == 0x22C2 || props.signType == NARY_INTERSECTION)
if(chrCode == 0x222B || chrType == NARY_INTEGRAL)
{
this.code = 0x22C2;
this.type = NARY_INTERSECTION;
sign = new CUnion(-1);
result.chrCode = 0x222B;
result.chrType = NARY_INTEGRAL;
result.operator = new CIntegral();
}
else if(signCode == 0x22C1 || props.signType == NARY_LOGICAL_OR)
else if(chrCode == 0x222C || chrType == NARY_DOUBLE_INTEGRAL)
{
this.code = 0x22C1;
this.type = NARY_LOGICAL_OR;
sign = new CLogicalOr();
result.chrCode = 0x222C;
result.chrType = NARY_DOUBLE_INTEGRAL;
result.operator = new CDoubleIntegral();
}
else if(signCode == 0x22C0 || props.signType == NARY_LOGICAL_AND)
else if(chrCode == 0x222D || chrType == NARY_TRIPLE_INTEGRAL)
{
this.code = 0x22C0;
this.type = NARY_LOGICAL_AND;
sign = new CLogicalOr(-1);
result.chrCode = 0x222D;
result.chrType = NARY_TRIPLE_INTEGRAL;
result.operator = new CTripleIntegral();
}
else if(bChr)
else if(chrCode == 0x222E || chrType == NARY_CONTOUR_INTEGRAL )
{
this.code = signCode;
this.type = NARY_TEXT_OPER;
sign = new CMathText(true);
sign.add(signCode);
result.chrCode = 0x222E;
result.chrType = NARY_CONTOUR_INTEGRAL;
result.operator = new CContourIntegral();
}
else
else if(chrCode == 0x222F || chrType == NARY_SURFACE_INTEGRAL )
{
this.code = 0x222B;
this.type = NARY_INTEGRAL;
sign = new CIntegral();
result.chrCode = 0x222F;
result.chrType = NARY_SURFACE_INTEGRAL;
result.operator = new CSurfaceIntegral();
}
var arg = new CMathContent(),
base;
if(this.limLoc === NARY_UndOvr)
else if(chrCode == 0x2230 || chrType == NARY_VOLUME_INTEGRAL)
{
if(this.supHide && this.subHide)
result.chrCode = 0x2230;
result.chrType = NARY_VOLUME_INTEGRAL;
result.operator = new CVolumeIntegral();
}
else if(chrCode == 0x2211 || chrType == NARY_SIGMA)
{
base = sign;
result.chrCode = 0x2211;
result.chrType = NARY_SIGMA;
result.operator = new CSigma();
}
else if( this.supHide && !this.subHide )
else if(chrCode == 0x220F || chrType == NARY_PRODUCT)
{
base = new CNaryOvr();
base.init(sign);
base.setCtrPrp(this.CtrPrp.Copy());
result.chrCode = 0x220F;
result.chrType = NARY_PRODUCT;
result.operator = new CProduct();
}
else if( !this.supHide && this.subHide )
else if(chrCode == 0x2210 || chrType == NARY_COPRODUCT)
{
base = new CNaryUnd();
base.init(sign);
base.setCtrPrp(this.CtrPrp.Copy());
result.chrCode = 0x2210;
result.chrType = NARY_COPRODUCT;
result.operator = new CProduct(-1);
}
else
else if(chrCode == 0x22C3 || chrType == NARY_UNION)
{
base = new CNaryUndOvr();
base.init(sign);
base.setCtrPrp(this.CtrPrp.Copy());
result.chrCode = 0x22C3;
result.chrType = NARY_UNION;
result.operator = new CUnion();
}
else if(chrCode == 0x22C2 || chrType == NARY_INTERSECTION)
{
result.chrCode = 0x22C2;
result.chrType = NARY_INTERSECTION;
result.operator = new CUnion(-1);
}
else
else if(chrCode == 0x22C1 || chrType == NARY_LOGICAL_OR)
{
if( this.supHide && !this.subHide )
result.chrCode = 0x22C1;
result.chrType = NARY_LOGICAL_OR;
result.operator = new CLogicalOr();
}
else if(chrCode == 0x22C0 || chrType == NARY_LOGICAL_AND)
{
var prp = {type: DEGREE_SUBSCRIPT, indef: 2, oBase: sign, ctrPrp: this.CtrPrp.Copy() };
base = new CDegree(prp);
result.chrCode = 0x22C0;
result.chrType = NARY_LOGICAL_AND;
result.operator = new CLogicalOr(-1);
}
else if( !this.supHide && this.subHide )
else if(bChr)
{
var prp = {type: DEGREE_SUPERSCRIPT, indef: 2, oBase: sign, ctrPrp: this.CtrPrp.Copy()};
base = new CDegree(prp);
result.chrCode = chrCode;
result.chrType = NARY_TEXT_OPER;
result.operator = new CMathText(true);
result.operator.add(chrCode);
}
else
{
var prp = {type: DEGREE_SubSup, indef: 2, oBase: sign, ctrPrp: this.CtrPrp.Copy()};
base = new CDegreeSubSup(prp);
}
result.chrCode = 0x222B;
result.chrType = NARY_INTEGRAL;
result.operator = new CIntegral();
}
/*if(!this.supHide || !this.subHide)
base.setCtrPrp(this.CtrPrp); */ // выставляем аналогично как в CMathContent при добавлении элемента в addMComponent
this.addMCToContent(base, arg);
/// вызов этой функции обязательно в конце
//this.WriteContentsToHistory();
return result;
}
CNary.prototype.setCtrPrp = function(txtPrp)
{
......@@ -238,12 +273,12 @@ CNary.prototype.getBase = function()
}
CNary.prototype.getUpperIterator = function()
{
if (!this.supHide)
if (!this.Pr.supHide)
return this.elements[0][0].getUpperIterator();
}
CNary.prototype.getLowerIterator = function()
{
if (!this.subHide)
if (!this.Pr.subHide)
return this.elements[0][0].getLowerIterator();
}
CNary.prototype.getPropsForWrite = function()
......
......@@ -3121,6 +3121,7 @@ COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch)
{
var width, height, ascent;
if(this.typeOper == OPERATOR_TEXT) // отдельный случай для текста в качестве оператора
{
var ctrPrp = this.Get_CompiledCtrPrp();
......@@ -3148,10 +3149,10 @@ COperator.prototype.fixSize = function(ParaMath, oMeasure, stretch)
height = this.operator.size.height;
}
var letterX = new CMathText(true);
/*var letterX = new CMathText(true);
letterX.add(0x78);
letterX.Resize(null, oMeasure);
this.shiftAccent = letterX.size.ascent;
this.shiftAccent = letterX.size.ascent;*/
}
else
{
......@@ -3295,88 +3296,65 @@ function CDelimiter(props)
this.endOper = new COperator (OPER_DELIMITER);
this.sepOper = new COperator (OPER_SEPARATOR);
this.shape = DELIMITER_SHAPE_CENTERED;
this.grow = true;
this.Pr =
{
begChr: null,
begChrType: null,
endChr: null,
endChrType: null,
this.code = null;
this.typeOper = null;
sepChr: null,
sepChrType: null,
//// special for "read" ////
this.column = 0;
////
column: 0,
shp: DELIMITER_SHAPE_CENTERED,
grow: true
};
//this.shape = DELIMITER_SHAPE_CENTERED;
//this.grow = true;
CMathBase.call(this);
this.init(props);
this.setCtrPrp(props.ctrPrp);
g_oTableId.Add( this, this.Id );
}
extend(CDelimiter, CMathBase);
CDelimiter.prototype.init = function(props)
{
if(props.grow == true || props.grow == 1)
this.grow = true;
this.Pr.grow = true;
else if(props.grow == false || props.grow == 0)
this.grow = false;
this.Pr.grow = false;
var begPrp =
{
chr: props.begChr,
type: props.begChrType,
loc: LOCATION_LEFT
};
var begDefaultPrp =
{
type: PARENTHESIS_LEFT
};
this.begOper.setProperties(begPrp, begDefaultPrp);
this.begOper.relate(this);
this.Pr.begChr = props.begChr;
this.Pr.begChrType = props.begChrType;
var endPrp =
{
chr: props.endChr,
type: props.endChrType,
loc: LOCATION_RIGHT
};
var endDefaultPrp =
{
type: PARENTHESIS_RIGHT
};
this.Pr.endChr = props.endChr;
this.Pr.endChrType = props.endChrType;
this.endOper.setProperties(endPrp, endDefaultPrp);
this.endOper.relate(this);
this.Pr.sepChr = props.sepChr;
this.Pr.sepChrType = props.sepChrType;
var sepPrp =
{
chr: props.sepChr,
type: props.sepChrType,
loc: LOCATION_SEP
};
var sepDefaultPrp =
{
type: DELIMITER_LINE
};
if(props.column == 1 )
sepPrp.type = OPERATOR_EMPTY;
this.sepOper.setProperties(sepPrp, sepDefaultPrp);
this.sepOper.relate(this);
if(props.shape == DELIMITER_SHAPE_MATH || props.shp == DELIMITER_SHAPE_MATH)
this.shape = DELIMITER_SHAPE_MATH;
this.Pr.shp = DELIMITER_SHAPE_MATH;
else if(props.shape == DELIMITER_SHAPE_CENTERED || props.shp == DELIMITER_SHAPE_CENTERED)
this.shape = DELIMITER_SHAPE_CENTERED;
this.Pr.shp = DELIMITER_SHAPE_CENTERED;
if(props.column === null || typeof(props.column) === "undefined" )
if(props.column === null || typeof(props.column) === "undefined")
props.column = 1;
if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined")
this.setCtrPrp(props.ctrPrp);
this.setDimension(1, props.column);
this.setContent();
/// вызов этой функции обязательно в конце
//this.WriteContentsToHistory();
}
CDelimiter.prototype.old_recalculateSize = function()
{
......@@ -3529,6 +3507,56 @@ CDelimiter.prototype.Resize = function(Parent, ParaMath, oMeasure)
this.RecalcInfo.bCtrPrp = false;
}
if(this.RecalcInfo.bProps == true)
{
var begPrp =
{
chr: this.Pr.begChr,
type: this.Pr.begChrType,
loc: LOCATION_LEFT
};
var begDefaultPrp =
{
type: PARENTHESIS_LEFT
};
this.begOper.setProperties(begPrp, begDefaultPrp);
this.begOper.relate(this);
var endPrp =
{
chr: this.Pr.endChr,
type: this.Pr.endChrType,
loc: LOCATION_RIGHT
};
var endDefaultPrp =
{
type: PARENTHESIS_RIGHT
};
this.endOper.setProperties(endPrp, endDefaultPrp);
this.endOper.relate(this);
var sepPrp =
{
chr: this.Pr.sepChr,
type: this.Pr.sepChrType,
loc: LOCATION_SEP
};
var sepDefaultPrp =
{
type: DELIMITER_LINE
};
if(this.nCol == 1 )
sepPrp.type = OPERATOR_EMPTY;
this.sepOper.setProperties(sepPrp, sepDefaultPrp);
this.sepOper.relate(this);
this.RecalcInfo.bProps = false;
}
// размеры аргумента
var heightG = 0, widthG = 0,
ascentG = 0, descentG = 0;
......@@ -3546,7 +3574,6 @@ CDelimiter.prototype.Resize = function(Parent, ParaMath, oMeasure)
heightG = ascentG + descentG;
var mgCtrPrp = this.Get_CompiledCtrPrp();
var shCenter = this.ParaMath.GetShiftCenter(oMeasure, mgCtrPrp);
var maxAD = ascentG - shCenter > descentG + shCenter ? ascentG - shCenter: descentG + shCenter;
......@@ -3554,7 +3581,7 @@ CDelimiter.prototype.Resize = function(Parent, ParaMath, oMeasure)
var plH = 9.877777777777776 * mgCtrPrp.FontSize/36;
var bTextContent = ascentG < plH || descentG < plH; // для текста операторы в случае центрирования не увеличиваем
var bCentered = this.shape == DELIMITER_SHAPE_CENTERED,
var bCentered = this.Pr.shp == DELIMITER_SHAPE_CENTERED,
b2Max = bCentered && (2*maxAD - heightG > 0.001);
......@@ -3580,7 +3607,7 @@ CDelimiter.prototype.Resize = function(Parent, ParaMath, oMeasure)
var height, ascent, descent;
if(this.shape == DELIMITER_SHAPE_CENTERED)
if(this.Pr.shp == DELIMITER_SHAPE_CENTERED)
{
var deltaHeight = heightG - maxDimOper.height;
if(deltaHeight < 0)
......@@ -3671,12 +3698,12 @@ CDelimiter.prototype.alignOperator = function(operator) // в качестве
if(bAlign)
{
if(this.shape == DELIMITER_SHAPE_CENTERED)
if(this.Pr.shp == DELIMITER_SHAPE_CENTERED)
{
align = this.size.ascent > dimOper.ascent ? this.size.ascent - dimOper.ascent : 0;
}
else if(this.shape === DELIMITER_SHAPE_MATH)
else if(this.Pr.shp === DELIMITER_SHAPE_MATH)
{
var shCenter = dimOper.ascent - dimOper.height/2; // так получаем shCenter, иначе соотношение м/ду ascent и descent будет неверное
......@@ -3911,14 +3938,13 @@ CDelimiter.prototype.Get_Id = function()
function CCharacter()
{
this.operator = new COperator(OPER_GROUP_CHAR);
this.shiftX = 0;
CMathBase.call(this);
}
extend(CCharacter, CMathBase);
CCharacter.prototype.setCharacter = function(props, defaultProps)
{
this.operator.init(props, defaultProps);
this.operator.setProperties(props, defaultProps);
this.operator.relate(this);
this.setDimension(1, 1);
......@@ -3940,17 +3966,13 @@ CCharacter.prototype.Resize = function(Parent, ParaMath, oMeasure)
this.operator.fixSize(ParaMath, oMeasure, base.size.width);
var letterX = new CMathText(true);
letterX.add(0x78);
letterX.Resize(null, oMeasure);
this.shiftX = base.size.ascent - letterX.size.ascent;
var ctrPrp = this.Get_CompiledCtrPrp();
oMeasure.SetFont(ctrPrp);
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,
height = base.size.height + this.operator.size.height,
ascent = this.getAscent(oMeasure);
var ctrPrp = this.Get_CompiledCtrPrp();
oMeasure.SetFont(ctrPrp);
this.size = {height: height, width: width, ascent: ascent};
}
......@@ -3961,7 +3983,7 @@ CCharacter.prototype.setPosition = function(pos)
var alignOp = this.align(this.operator),
alignCnt = this.align(this.elements[0][0]);
if(this.loc === LOCATION_TOP)
if(this.Pr.pos === LOCATION_TOP)
{
var x1 = this.pos.x + this.GapLeft + alignOp,
y1 = this.pos.y;
......@@ -3969,11 +3991,11 @@ CCharacter.prototype.setPosition = function(pos)
this.operator.setPosition({x: x1, y: y1});
var x2 = this.pos.x + this.GapLeft + alignCnt,
y2 = this.pos.y + this.operator.size.height + this.shiftX;
y2 = this.pos.y + this.operator.size.height;
this.elements[0][0].setPosition({x: x2, y: y2});
}
else if(this.loc === LOCATION_BOT)
else if(this.Pr.pos === LOCATION_BOT)
{
var x1 = this.pos.x + this.GapLeft + alignCnt,
y1 = this.pos.y;
......@@ -4035,7 +4057,7 @@ CCharacter.prototype.findDisposition = function(pos)
else
X = pos.x - align;
if(this.loc === LOCATION_TOP)
if(this.Pr.pos === LOCATION_TOP)
{
if(pos.y < this.operator.size.height)
{
......@@ -4045,7 +4067,7 @@ CCharacter.prototype.findDisposition = function(pos)
else
Y = pos.y - this.operator.size.height;
}
else if(this.loc === LOCATION_BOT)
else if(this.Pr.pos === LOCATION_BOT)
{
if(pos.y > content.size.height)
{
......@@ -4067,14 +4089,21 @@ CCharacter.prototype.getBase = function()
}
function CGroupCharacter(props)
{
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_GROUP_CHARACTER;
this.vertJust = VJUST_TOP;
this.loc = LOCATION_BOT;
this.Pr =
{
chr: null,
chrType: null,
vertJc: VJUST_TOP,
pos: LOCATION_BOT
};
//this.vertJust = VJUST_TOP;
//this.loc = LOCATION_BOT;
CCharacter.call(this);
......@@ -4084,10 +4113,15 @@ extend(CGroupCharacter, CCharacter);
CGroupCharacter.prototype.init = function(props)
{
if(props.vertJc === VJUST_TOP || props.vertJc === VJUST_BOT)
this.vertJust = props.vertJc;
this.Pr.vertJc = props.vertJc;
if(props.pos === LOCATION_TOP || props.pos === LOCATION_BOT)
this.loc = LOCATION_TOP;
this.Pr.pos = props.pos;
this.Pr.chr = props.chr;
this.Pr.chrType = props.chrType;
///////////////////////////////////////////////////////////////
var operDefaultPrp =
{
......@@ -4097,34 +4131,68 @@ CGroupCharacter.prototype.init = function(props)
var operProps =
{
type: props.chrType,
chr: props.chr,
loc: this.loc
type: this.Pr.chrType,
chr: this.Pr.chr,
loc: this.Pr.pos
};
this.setCharacter(operProps, operDefaultPrp);
this.Pr.chrType = this.operator.typeOper;
this.Pr.chr = String.fromCharCode(this.operator.code);
//////////////////////////////////////////////////////////////////
if(props.ctrPrp !== null && typeof(props.ctrPrp)!== "undefined")
this.setCtrPrp(props.ctrPrp);
/// вызов этой функции обязательно в конце
g_oTableId.Add( this, this.Id );
}
CGroupCharacter.prototype.Resize = function(Parent, ParaMath, oMeasure)
{
if(this.RecalcInfo.bProps == true)
{
var operDefaultPrp =
{
type: BRACKET_CURLY_BOTTOM,
loc: LOCATION_BOT
};
var operProps =
{
type: this.Pr.chrType,
chr: this.Pr.chr,
loc: this.Pr.pos
};
this.setCharacter(operProps, operDefaultPrp);
this.Pr.chrType = this.operator.typeOper;
this.Pr.chr = String.fromCharCode(this.operator.code);
this.RecalcInfo.bProps = false;
}
CGroupCharacter.superclass.Resize.call(this, Parent, ParaMath, oMeasure);
}
CGroupCharacter.prototype.getAscent = function(oMeasure)
{
var ascent;
//var shCent = DIV_CENT*this.getCtrPrp().FontSize;
var ctrPrp = this.Get_CompiledCtrPrp();
var shCent = this.ParaMath.GetShiftCenter(oMeasure, ctrPrp);
if(this.vertJust === VJUST_TOP && this.loc === LOCATION_TOP)
if(this.Pr.vertJc === VJUST_TOP && this.Pr.pos === LOCATION_TOP)
ascent = this.operator.size.ascent + shCent;
else if(this.vertJust === VJUST_BOT && this.loc === LOCATION_TOP )
else if(this.Pr.vertJc === VJUST_BOT && this.Pr.pos === LOCATION_TOP )
ascent = this.operator.size.height + this.elements[0][0].size.ascent;
else if(this.vertJust === VJUST_TOP && this.loc === LOCATION_BOT )
else if(this.Pr.vertJc === VJUST_TOP && this.Pr.pos === LOCATION_BOT )
ascent = this.elements[0][0].size.ascent;
else if(this.vertJust === VJUST_BOT && this.loc === LOCATION_BOT )
else if(this.Pr.vertJc === VJUST_BOT && this.Pr.pos === LOCATION_BOT )
ascent = this.elements[0][0].size.height + shCent + this.operator.size.height - this.operator.size.ascent;
//ascent = this.operator.size.height/2 + shCent + this.elements[0][0].size.height;
......@@ -4289,20 +4357,10 @@ CGroupCharacter.prototype.old_getGlyph = function(code, type)
}
return operator;
}
CGroupCharacter.prototype.setPos = function() // change location
{
}
CGroupCharacter.prototype.getPropsForWrite = function()
{
var props = {
chr: this.operator.getChr(),
pos: this.loc,
vertJc: this.vertJc
};
return props;
return this.Pr;
}
CGroupCharacter.prototype.Save_Changes = function(Data, Writer)
{
......
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