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

Реализовала функции fillMathComposition для классов CGroupCharacter,...

Реализовала функции fillMathComposition для классов CGroupCharacter, CDelimiters, CNary, CRadical, CDegree, CDegreeSubSup


git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56552 954022d7-b5bf-4e40-9824-e11837661b57
parent 45a63b6f
...@@ -184,7 +184,7 @@ CMathBase.prototype = ...@@ -184,7 +184,7 @@ CMathBase.prototype =
for(var i=0; i < this.nRow; i++) for(var i=0; i < this.nRow; i++)
for(var j = 0; j < this.nCol; j++) for(var j = 0; j < this.nCol; j++)
if( !this.elements[i][j].IsJustDraw()) if( !this.elements[i][j].IsJustDraw() )
this.elements[i][j].setArgSize(argSize); this.elements[i][j].setArgSize(argSize);
}, },
// TO DO // TO DO
...@@ -328,8 +328,7 @@ CMathBase.prototype = ...@@ -328,8 +328,7 @@ CMathBase.prototype =
bUpperLevel = true; bUpperLevel = true;
break; break;
} }
} while( this.elements[this.CurPos_X][this.CurPos_Y].IsJustDraw() ) } while( this.elements[this.CurPos_X][this.CurPos_Y].IsJustDraw() );
;
//из цикла вышли если bJustDraw = false or bUpperLevel = true //из цикла вышли если bJustDraw = false or bUpperLevel = true
...@@ -366,8 +365,7 @@ CMathBase.prototype = ...@@ -366,8 +365,7 @@ CMathBase.prototype =
bUpperLevel = true; bUpperLevel = true;
break; break;
} }
} while( this.elements[this.CurPos_X][this.CurPos_Y].IsJustDraw() ) } while( this.elements[this.CurPos_X][this.CurPos_Y].IsJustDraw() );
;
var content; var content;
if( bUpperLevel ) if( bUpperLevel )
......
...@@ -28,11 +28,11 @@ CDegree.prototype.fillContent = function() ...@@ -28,11 +28,11 @@ CDegree.prototype.fillContent = function()
{ {
var oBase = new CMathContent(); var oBase = new CMathContent();
if(props.indef == 2) /// props include Base for CNary /*if(props.indef == 2) /// props include Base for CNary
{ {
oBase = props.oBase; oBase = props.oBase;
oBase.setCtrPrp(props.ctrPrp); oBase.setCtrPrp(props.ctrPrp);
} }*/
this.setDimension(1, 2); this.setDimension(1, 2);
...@@ -467,6 +467,18 @@ CDegree.prototype.fillMathComposition = function(props, contents /*array*/) ...@@ -467,6 +467,18 @@ CDegree.prototype.fillMathComposition = function(props, contents /*array*/)
// Iterator // Iterator
this.elements[0][1] = contents[1]; this.elements[0][1] = contents[1];
} }
CDegree.prototype.changeBase = function(base)
{
this.elements[0][0] = base;
}
CDegree.prototype.changeUpperIterator = function(iterator)
{
this.elements[0][1] = iterator;
}
CDegree.prototype.changeLowerIterator = function(iterator)
{
this.elements[0][1] = iterator;
}
CDegree.prototype.getPropsForWrite = function() CDegree.prototype.getPropsForWrite = function()
{ {
return this.Pr; return this.Pr;
...@@ -635,6 +647,14 @@ CIterators.prototype.getLowerIterator = function() ...@@ -635,6 +647,14 @@ CIterators.prototype.getLowerIterator = function()
{ {
return this.elements[1][0]; return this.elements[1][0];
} }
CIterators.prototype.changeUpperIterator = function(iterator)
{
this.elements[0][0] = iterator;
}
CIterators.prototype.changeLowerIterator = function(iterator)
{
this.elements[1][0] = iterator;
}
CIterators.prototype.Get_CompiledCtrPrp = function() CIterators.prototype.Get_CompiledCtrPrp = function()
{ {
return this.Parent.Get_CompiledCtrPrp(); return this.Parent.Get_CompiledCtrPrp();
...@@ -678,12 +698,6 @@ CDegreeSubSup.prototype.fillContent = function() ...@@ -678,12 +698,6 @@ CDegreeSubSup.prototype.fillContent = function()
{ {
var oBase = new CMathContent(); var oBase = new CMathContent();
if(props.indef == 2) /// props include Base for CNary
{
oBase = props.oBase;
oBase.setCtrPrp(props.ctrPrp);
}
this.setDimension(1, 2); this.setDimension(1, 2);
var oIters = new CIterators(); var oIters = new CIterators();
...@@ -1098,6 +1112,20 @@ CDegreeSubSup.prototype.getLowerIterator = function() ...@@ -1098,6 +1112,20 @@ CDegreeSubSup.prototype.getLowerIterator = function()
return iter; return iter;
} }
CDegreeSubSup.prototype.changeUpperIterator = function(iterator)
{
if(this.Pr.type == DEGREE_SubSup)
this.elements[0][1].changeUpperIterator(iterator);
else
this.elements[0][0].changeUpperIterator(iterator);
}
CDegreeSubSup.prototype.changeLowerIterator = function(iterator)
{
if(this.Pr.type == DEGREE_SubSup)
this.elements[0][1].changeLowerIterator(iterator);
else
this.elements[0][0].changeLowerIterator(iterator);
}
CDegreeSubSup.prototype.setProperties = function(props) CDegreeSubSup.prototype.setProperties = function(props)
{ {
if(props.alnScr === true || props.alnScr === 1) if(props.alnScr === true || props.alnScr === 1)
...@@ -1134,6 +1162,13 @@ CDegreeSubSup.prototype.fillMathComposition = function(props, contents /*array*/ ...@@ -1134,6 +1162,13 @@ CDegreeSubSup.prototype.fillMathComposition = function(props, contents /*array*/
this.elements[0][0].fillMathComposition(contents[1]/*upper iterator*/, contents[2]/*lower iterator*/); this.elements[0][0].fillMathComposition(contents[1]/*upper iterator*/, contents[2]/*lower iterator*/);
} }
} }
CDegreeSubSup.prototype.changeBase = function(base)
{
if(this.Pr.type == DEGREE_SubSup)
this.elements[0][0] = base;
else
this.elements[0][1] = base;
}
CDegreeSubSup.prototype.getPropsForWrite = function() CDegreeSubSup.prototype.getPropsForWrite = function()
{ {
return this.Pr; return this.Pr;
......
...@@ -18,7 +18,6 @@ function CNary(props) ...@@ -18,7 +18,6 @@ function CNary(props)
limLoc: null limLoc: null
}; };
CMathBase.call(this); CMathBase.call(this);
if(props !== null && typeof(props) !== "undefined") if(props !== null && typeof(props) !== "undefined")
...@@ -28,6 +27,11 @@ function CNary(props) ...@@ -28,6 +27,11 @@ function CNary(props)
} }
extend(CNary, CMathBase); extend(CNary, CMathBase);
CNary.prototype.init = function(props) CNary.prototype.init = function(props)
{
this.setProperties(props);
this.fillContent();
}
CNary.prototype.setProperties = function(props)
{ {
this.setCtrPrp(props.ctrPrp); this.setCtrPrp(props.ctrPrp);
...@@ -40,81 +44,92 @@ CNary.prototype.init = function(props) ...@@ -40,81 +44,92 @@ CNary.prototype.init = function(props)
if(props.grow === true || props.grow === 1) if(props.grow === true || props.grow === 1)
this.Pr.grow = true; this.Pr.grow = true;
this.setDimension(1, 2);
var oSign = this.getSign(props.chr, props.signType);
this.Pr.chrType = props.chrType; this.Pr.chrType = props.chrType;
this.Pr.chr = props.chr; this.Pr.chr = props.chr;
if(props.limLoc == NARY_UndOvr)
this.Pr.limLoc = NARY_UndOvr;
else if(props.limLoc == NARY_SubSup)
this.Pr.limLoc = NARY_SubSup;
else
{
var bIntegral = oSign.chrCode > 0x222A && oSign.chrCode < 0x2231;
if(bIntegral) if(props.limLoc == NARY_UndOvr || props.limLoc == NARY_SubSup)
this.Pr.limLoc = g_oMathSettings.intLim; this.Pr.limLoc = props.limLoc;
else }
this.Pr.limLoc = g_oMathSettings.naryLim; CNary.prototype.fillContent = function()
} {
this.setDimension(1, 2);
var arg = new CMathContent(), var arg = new CMathContent(),
base; base;
var ctrPrp = this.CtrPrp.Copy();
if(this.Pr.limLoc === NARY_UndOvr) if(this.Pr.limLoc === NARY_UndOvr)
{ {
if(this.Pr.supHide && this.Pr.subHide) if(this.Pr.supHide && this.Pr.subHide)
{ {
base = oSign.operator; base = new CMathText(true);
} }
else if( this.Pr.supHide && !this.Pr.subHide ) else if( this.Pr.supHide && !this.Pr.subHide )
{ {
base = new CNaryOvr(); base = new CNaryOvr();
base.init(oSign.operator); //base.init(oBase);
base.setCtrPrp(this.CtrPrp.Copy()); base.setCtrPrp(ctrPrp);
} }
else if( !this.Pr.supHide && this.Pr.subHide ) else if( !this.Pr.supHide && this.Pr.subHide )
{ {
base = new CNaryUnd(); base = new CNaryUnd();
base.init(oSign.operator); //base.init(oBase);
base.setCtrPrp(this.CtrPrp.Copy()); base.setCtrPrp(ctrPrp);
} }
else else
{ {
base = new CNaryUndOvr(); base = new CNaryUndOvr();
base.init(oSign.operator); //base.init(oBase);
base.setCtrPrp(this.CtrPrp.Copy()); base.setCtrPrp(ctrPrp);
} }
} }
else else
{ {
var prp; var prp;
if( this.Pr.supHide && !this.Pr.subHide ) if( this.Pr.supHide && !this.Pr.subHide )
{ {
prp = {type: DEGREE_SUBSCRIPT, indef: 2, oBase: oSign.operator, ctrPrp: this.CtrPrp.Copy() }; prp = {type: DEGREE_SUBSCRIPT, ctrPrp: ctrPrp };
base = new CDegree(prp); base = new CDegree(prp);
} }
else if( !this.Pr.supHide && this.Pr.subHide ) else if( !this.Pr.supHide && this.Pr.subHide )
{ {
prp = {type: DEGREE_SUPERSCRIPT, indef: 2, oBase: oSign.operator, ctrPrp: this.CtrPrp.Copy()}; prp = {type: DEGREE_SUPERSCRIPT, ctrPrp: ctrPrp};
base = new CDegree(prp); base = new CDegree(prp);
} }
else else
{ {
prp = {type: DEGREE_SubSup, indef: 2, oBase: oSign.operator, ctrPrp: this.CtrPrp.Copy()}; prp = {type: DEGREE_SubSup, ctrPrp: ctrPrp};
base = new CDegreeSubSup(prp); base = new CDegreeSubSup(prp);
} }
} }
this.addMCToContent(base, arg); this.addMCToContent(base, arg);
}
CNary.prototype.fillMathComposition = function(props, contents /*array*/)
{
this.setProperties(props);
this.fillContent();
// Base
this.elements[0][1] = contents[0];
// Upper iterator
if(!this.Pr.subHide)
this.elements[0][0].changeUpperIterator(contents[1]);
// Lower iterator
if(!this.Pr.subHide)
this.elements[0][0].changeLowerIterator(contents[2]);
} }
CNary.prototype.Resize = function(Parent, ParaMath, oMeasure) CNary.prototype.Resize = function(Parent, ParaMath, oMeasure)
{ {
...@@ -122,6 +137,22 @@ CNary.prototype.Resize = function(Parent, ParaMath, oMeasure) ...@@ -122,6 +137,22 @@ CNary.prototype.Resize = function(Parent, ParaMath, oMeasure)
{ {
var oSign = this.getSign(this.Pr.chr, this.Pr.chrType); var oSign = this.getSign(this.Pr.chr, this.Pr.chrType);
if(this.Pr.limLoc == null || typeof(this.Pr.limLoc) == "undefined")
{
var bIntegral = oSign.chrCode > 0x222A && oSign.chrCode < 0x2231;
if(bIntegral)
this.Pr.limLoc = g_oMathSettings.intLim;
else
this.Pr.limLoc = g_oMathSettings.naryLim;
}
if(this.Pr.supHide && this.Pr.subHide)
this.elements[0][0] = oSign.operator;
else
this.elements[0][0].changeBase(oSign.operator);
this.Pr.chrType = oSign.chrType; this.Pr.chrType = oSign.chrType;
this.Pr.chr = String.fromCharCode(oSign.chrCode); this.Pr.chr = String.fromCharCode(oSign.chrCode);
} }
...@@ -354,16 +385,28 @@ function CNaryUnd() ...@@ -354,16 +385,28 @@ function CNaryUnd()
CMathBase.call(this); CMathBase.call(this);
} }
extend(CNaryUnd, CMathBase); extend(CNaryUnd, CMathBase);
CNaryUnd.prototype.init = function(sign) CNaryUnd.prototype.init = function()
{ {
this.setDimension(2,1); this.setDimension(2, 1);
var iter = new CMathContent(); var iter = new CMathContent();
iter.decreaseArgSize(); iter.decreaseArgSize();
//sign.relate(this); var base = new CMathContent();
this.addMCToContent(iter, base);
}
CNaryUnd.prototype.old_init = function(sign)
{
this.setDimension(2,1);
var iter = new CMathContent();
iter.decreaseArgSize();
this.addMCToContent(iter, sign); this.addMCToContent(iter, sign);
} }
CNaryUnd.prototype.changeBase = function(base)
{
this.elements[1][0] = base;
}
CNaryUnd.prototype.setDistance = function() CNaryUnd.prototype.setDistance = function()
{ {
var zetta = this.Get_CompiledCtrPrp().FontSize* 25.4/96; var zetta = this.Get_CompiledCtrPrp().FontSize* 25.4/96;
...@@ -377,6 +420,10 @@ CNaryUnd.prototype.getUpperIterator = function() ...@@ -377,6 +420,10 @@ CNaryUnd.prototype.getUpperIterator = function()
{ {
return this.elements[0][0]; return this.elements[0][0];
} }
CNaryUnd.prototype.changeUpperIterator = function(iterator)
{
this.elements[0][0] = iterator;
}
function CNaryOvr() function CNaryOvr()
...@@ -384,7 +431,17 @@ function CNaryOvr() ...@@ -384,7 +431,17 @@ function CNaryOvr()
CMathBase.call(this); CMathBase.call(this);
} }
extend(CNaryOvr, CMathBase); extend(CNaryOvr, CMathBase);
CNaryOvr.prototype.init = function(sign) CNaryOvr.prototype.init = function()
{
this.setDimension(2, 1);
var iter = new CMathContent();
iter.decreaseArgSize();
var base = new CMathContent();
this.addMCToContent(base, iter);
}
CNaryOvr.prototype.old_init = function(sign)
{ {
this.setDimension(2,1); this.setDimension(2,1);
var iter = new CMathContent(); var iter = new CMathContent();
...@@ -394,6 +451,10 @@ CNaryOvr.prototype.init = function(sign) ...@@ -394,6 +451,10 @@ CNaryOvr.prototype.init = function(sign)
this.addMCToContent(sign, iter); this.addMCToContent(sign, iter);
} }
CNaryOvr.prototype.changeBase = function(base)
{
this.elements[0][0] = base;
}
CNaryOvr.prototype.old_setDistance = function() CNaryOvr.prototype.old_setDistance = function()
{ {
var zetta = this.Get_CompiledCtrPrp().FontSize* 25.4/96; var zetta = this.Get_CompiledCtrPrp().FontSize* 25.4/96;
...@@ -424,10 +485,14 @@ CNaryOvr.prototype.old_getAscent = function() ...@@ -424,10 +485,14 @@ CNaryOvr.prototype.old_getAscent = function()
{ {
return this.elements[0][0].size.ascent; return this.elements[0][0].size.ascent;
} }
CNaryOvr.prototype.getLowerIterator= function() CNaryOvr.prototype.getLowerIterator = function()
{ {
return this.elements[1][0]; return this.elements[1][0];
} }
CNaryOvr.prototype.changeLowerIterator = function(iterator)
{
this.elements[1][0] = iterator;
}
function CNaryUndOvr() function CNaryUndOvr()
{ {
...@@ -436,7 +501,7 @@ function CNaryUndOvr() ...@@ -436,7 +501,7 @@ function CNaryUndOvr()
CMathBase.call(this); CMathBase.call(this);
} }
extend(CNaryUndOvr, CMathBase); extend(CNaryUndOvr, CMathBase);
CNaryUndOvr.prototype.init = function(sign) CNaryUndOvr.prototype.init = function()
{ {
this.setDimension(3,1); this.setDimension(3,1);
...@@ -446,7 +511,13 @@ CNaryUndOvr.prototype.init = function(sign) ...@@ -446,7 +511,13 @@ CNaryUndOvr.prototype.init = function(sign)
var iter2 = new CMathContent(); var iter2 = new CMathContent();
iter2.decreaseArgSize(); iter2.decreaseArgSize();
this.addMCToContent(iter1, sign, iter2); var base = new CMathContent();
this.addMCToContent(iter1, base, iter2);
}
CNaryUndOvr.prototype.changeBase = function(base)
{
this.elements[1][0] = base;
} }
CNaryUndOvr.prototype.recalculateSize = function() CNaryUndOvr.prototype.recalculateSize = function()
{ {
...@@ -558,6 +629,14 @@ CNaryUndOvr.prototype.findDisposition = function(mCoord) ...@@ -558,6 +629,14 @@ CNaryUndOvr.prototype.findDisposition = function(mCoord)
return {pos: {x: pos_x, y: pos_y}, mCoord: {x: X, y: Y}, inside_flag: inside_flag}; return {pos: {x: pos_x, y: pos_y}, mCoord: {x: X, y: Y}, inside_flag: inside_flag};
} }
CNaryUndOvr.prototype.changeUpperIterator = function(iterator)
{
this.elements[0][0] = iterator;
}
CNaryUndOvr.prototype.changeLowerIterator = function(iterator)
{
this.elements[2][0] = iterator;
}
CNaryUndOvr.prototype.getLowerIterator = function() CNaryUndOvr.prototype.getLowerIterator = function()
{ {
return this.elements[2][0]; return this.elements[2][0];
......
...@@ -3309,8 +3309,6 @@ function CDelimiter(props) ...@@ -3309,8 +3309,6 @@ function CDelimiter(props)
sepChr: null, sepChr: null,
sepChrType: null, sepChrType: null,
//// special for "read" ////
column: 0, column: 0,
shp: DELIMITER_SHAPE_CENTERED, shp: DELIMITER_SHAPE_CENTERED,
...@@ -3321,14 +3319,23 @@ function CDelimiter(props) ...@@ -3321,14 +3319,23 @@ function CDelimiter(props)
//this.grow = true; //this.grow = true;
//// special for "read" ////
this.column = 0;
CMathBase.call(this); CMathBase.call(this);
this.init(props); if(props !== null && typeof(props) !== "undefined")
this.init(props);
g_oTableId.Add( this, this.Id ); g_oTableId.Add( this, this.Id );
} }
extend(CDelimiter, CMathBase); extend(CDelimiter, CMathBase);
CDelimiter.prototype.init = function(props) CDelimiter.prototype.init = function(props)
{
this.setProperties(props);
this.fillContent();
}
CDelimiter.prototype.setProperties = function(props)
{ {
if(props.grow == true || props.grow == 1) if(props.grow == true || props.grow == 1)
this.Pr.grow = true; this.Pr.grow = true;
...@@ -3344,21 +3351,30 @@ CDelimiter.prototype.init = function(props) ...@@ -3344,21 +3351,30 @@ CDelimiter.prototype.init = function(props)
this.Pr.sepChr = props.sepChr; this.Pr.sepChr = props.sepChr;
this.Pr.sepChrType = props.sepChrType; this.Pr.sepChrType = props.sepChrType;
if(props.column !== null || typeof(props.column) !== "undefined")
this.Pr.column = props.column;
else
this.Pr.column = 1;
if(props.shape == DELIMITER_SHAPE_MATH || props.shp == DELIMITER_SHAPE_MATH) if(props.shp == DELIMITER_SHAPE_MATH || props.shp == DELIMITER_SHAPE_CENTERED)
this.Pr.shp = DELIMITER_SHAPE_MATH; this.Pr.shp = props.shp;
else if(props.shape == DELIMITER_SHAPE_CENTERED || props.shp == DELIMITER_SHAPE_CENTERED)
this.Pr.shp = DELIMITER_SHAPE_CENTERED;
if(props.column === null || typeof(props.column) === "undefined")
props.column = 1;
if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined") if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined")
this.setCtrPrp(props.ctrPrp); this.setCtrPrp(props.ctrPrp);
}
this.setDimension(1, props.column); CDelimiter.prototype.fillContent = function()
{
this.setDimension(1, this.Pr.column);
this.setContent(); this.setContent();
} }
CDelimiter.prototype.fillMathComposition = function(props, contents /*array*/)
{
this.setProperties(props);
this.fillContent();
for(var j = 0; j < this.nCol; j++)
this.elements[0][j] = contents[j];
}
CDelimiter.prototype.old_recalculateSize = function() CDelimiter.prototype.old_recalculateSize = function()
{ {
var height = 0, var height = 0,
...@@ -4150,23 +4166,20 @@ function CGroupCharacter(props) ...@@ -4150,23 +4166,20 @@ function CGroupCharacter(props)
CCharacter.call(this); CCharacter.call(this);
this.init(props); if(props !== null && typeof(props)!== "undefined")
this.init(props);
/// вызов этой функции обязательно в конце
g_oTableId.Add( this, this.Id );
} }
extend(CGroupCharacter, CCharacter); extend(CGroupCharacter, CCharacter);
CGroupCharacter.prototype.init = function(props) CGroupCharacter.prototype.init = function(props)
{ {
if(props.vertJc === VJUST_TOP || props.vertJc === VJUST_BOT)
this.Pr.vertJc = props.vertJc;
if(props.pos === LOCATION_TOP || props.pos === LOCATION_BOT)
this.Pr.pos = props.pos;
this.Pr.chr = props.chr;
this.Pr.chrType = props.chrType;
/////////////////////////////////////////////////////////////// this.setProperties(props);
this.fillContent();
var operDefaultPrp = /*var operDefaultPrp =
{ {
type: BRACKET_CURLY_BOTTOM, type: BRACKET_CURLY_BOTTOM,
loc: LOCATION_BOT loc: LOCATION_BOT
...@@ -4182,16 +4195,8 @@ CGroupCharacter.prototype.init = function(props) ...@@ -4182,16 +4195,8 @@ CGroupCharacter.prototype.init = function(props)
this.setCharacter(operProps, operDefaultPrp); this.setCharacter(operProps, operDefaultPrp);
this.Pr.chrType = this.operator.typeOper; this.Pr.chrType = this.operator.typeOper;
this.Pr.chr = String.fromCharCode(this.operator.code); 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) CGroupCharacter.prototype.Resize = function(Parent, ParaMath, oMeasure)
{ {
...@@ -4220,6 +4225,31 @@ CGroupCharacter.prototype.Resize = function(Parent, ParaMath, oMeasure) ...@@ -4220,6 +4225,31 @@ CGroupCharacter.prototype.Resize = function(Parent, ParaMath, oMeasure)
CGroupCharacter.superclass.Resize.call(this, Parent, ParaMath, oMeasure); CGroupCharacter.superclass.Resize.call(this, Parent, ParaMath, oMeasure);
} }
CGroupCharacter.prototype.setProperties = function(props)
{
if(props.vertJc === VJUST_TOP || props.vertJc === VJUST_BOT)
this.Pr.vertJc = props.vertJc;
if(props.pos === LOCATION_TOP || props.pos === LOCATION_BOT)
this.Pr.pos = props.pos;
this.Pr.chr = props.chr;
this.Pr.chrType = props.chrType;
this.setCtrPrp(props.ctrPrp);
}
CGroupCharacter.prototype.fillContent = function()
{
this.setDimension(1, 1);
this.setContent();
}
CGroupCharacter.prototype.fillMathComposition = function(props, contents /*array*/)
{
this.setProperties(props);
this.fillContent();
this.elements[0][0] = contents[0];
}
CGroupCharacter.prototype.getAscent = function(oMeasure) CGroupCharacter.prototype.getAscent = function(oMeasure)
{ {
var ascent; var ascent;
......
...@@ -902,12 +902,19 @@ function CRadical(props) ...@@ -902,12 +902,19 @@ function CRadical(props)
CMathBase.call(this); CMathBase.call(this);
this.init(props); if(props !== null && typeof(props)!== "undefined")
this.setCtrPrp(props.ctrPrp); this.init(props);
g_oTableId.Add( this, this.Id ); g_oTableId.Add( this, this.Id );
} }
extend(CRadical, CMathBase); extend(CRadical, CMathBase);
CRadical.prototype.init = function(props) CRadical.prototype.init = function(props)
{
this.setProperties(props);
this.fillContent();
}
CRadical.prototype.setProperties = function(props)
{ {
if(props.type === SQUARE_RADICAL || props.type === DEGREE_RADICAL) if(props.type === SQUARE_RADICAL || props.type === DEGREE_RADICAL)
this.Pr.type = props.type; this.Pr.type = props.type;
...@@ -917,9 +924,10 @@ CRadical.prototype.init = function(props) ...@@ -917,9 +924,10 @@ CRadical.prototype.init = function(props)
else if(props.degHide == false || props.degHide === 0) else if(props.degHide == false || props.degHide === 0)
this.Pr.type = DEGREE_RADICAL; this.Pr.type = DEGREE_RADICAL;
this.setDimension(1, 1); this.setCtrPrp(props.ctrPrp);
this.setContent(); }
CRadical.prototype.fillContent = function()
{
this.signRadical = new CSignRadical(); this.signRadical = new CSignRadical();
this.signRadical.relate(this); this.signRadical.relate(this);
...@@ -933,14 +941,23 @@ CRadical.prototype.init = function(props) ...@@ -933,14 +941,23 @@ CRadical.prototype.init = function(props)
this.setDimension(1, 2); this.setDimension(1, 2);
var oBase = new CMathContent(); var oBase = new CMathContent();
var oDegree = new CMathContent(); var oDegree = new CMathContent();
//oDegree.decreaseArgSize();
oDegree.setArgSize(-2); oDegree.setArgSize(-2);
this.addMCToContent(oDegree, oBase); this.addMCToContent(oDegree, oBase);
} }
}
CRadical.prototype.fillMathComposition = function(props, contents /*array*/)
{
this.setProperties(props);
this.fillContent();
if(this.Pr.type == SQUARE_RADICAL)
this.elements[0][0] = contents[0];
else if(this.Pr.type == DEGREE_RADICAL)
this.elements[0][1] = contents[0];
/// вызов этой функции обязательно в конце if(this.Pr.degHide == false)
// this.WriteContentsToHistory(); this.elements[0][0] = contents[1];
} }
CRadical.prototype.recalculateSize = function(oMeasure) CRadical.prototype.recalculateSize = function(oMeasure)
{ {
......
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