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 = ...@@ -786,13 +786,13 @@ ParaMath.prototype =
if(argSize == -1) if(argSize == -1)
{ {
//FSize = 0.0009*FSize*FSize + 0.68*FSize + 0.26; //FSize = 0.0009*FSize*FSize + 0.68*FSize + 0.26;
FSize = 0.77*FSize; FSize = 0.76*FSize;
} }
else if(argSize == -2) else if(argSize == -2)
{ {
//FSize = -0.0004*FSize*FSize + 0.66*FSize + 0.87; //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; tPrp.FontSize = FSize;
......
...@@ -1640,8 +1640,8 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure) ...@@ -1640,8 +1640,8 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure)
this.operator.setProperties(prp, defaultPrp); this.operator.setProperties(prp, defaultPrp);
this.chr = String.fromCharCode(this.operator.code); this.Pr.chr = String.fromCharCode(this.operator.code);
this.chrType = this.operator.typeOper; this.Pr.chrType = this.operator.typeOper;
} }
this.operator.relate(this); this.operator.relate(this);
......
...@@ -976,7 +976,7 @@ CMathBase.prototype = ...@@ -976,7 +976,7 @@ CMathBase.prototype =
width += this.dW*(this.nCol - 1); width += this.dW*(this.nCol - 1);
width += this.GapLeft + this.GapRight; 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}; this.size = {width: width, height: height, ascent: ascent};
}, },
...@@ -994,7 +994,7 @@ CMathBase.prototype = ...@@ -994,7 +994,7 @@ CMathBase.prototype =
{ {
this.Set_CompiledCtrPrp(); this.Set_CompiledCtrPrp();
this.RecalcInfo.bCtrPrp = false; this.RecalcInfo.bCtrPrp = false;
this.RecalcInfo.bProps = false; //this.RecalcInfo.bProps = false;
} }
for(var i=0; i < this.nRow; i++) for(var i=0; i < this.nRow; i++)
...@@ -1017,12 +1017,12 @@ CMathBase.prototype = ...@@ -1017,12 +1017,12 @@ CMathBase.prototype =
return res; return res;
}, },
getAscent: function(_height, oMeasure) getAscent: function(oMeasure, _height)
{ {
var Ascent = 0; var Ascent = 0;
if(this.nRow > 1) if(this.nRow > 1)
{ {
Ascent = _height || this.size.height; Ascent = _height;
Ascent /=2; Ascent /=2;
var MergedCtrPrp = this.Get_CompiledCtrPrp(); var MergedCtrPrp = this.Get_CompiledCtrPrp();
Ascent += this.ParaMath.GetShiftCenter(oMeasure, MergedCtrPrp); Ascent += this.ParaMath.GetShiftCenter(oMeasure, MergedCtrPrp);
......
...@@ -22,10 +22,10 @@ function CBorderBox(props) ...@@ -22,10 +22,10 @@ function CBorderBox(props)
hideRight: false, hideRight: false,
hideTop: false, hideTop: false,
hideBot: false, hideBot: false,
strikeBLTR: true, strikeBLTR: false,
strikeTLBR: true, strikeTLBR: false,
strikeH: true, strikeH: false,
strikeV: true strikeV: false
}; };
CMathBase.call(this); CMathBase.call(this);
...@@ -62,35 +62,36 @@ CBorderBox.prototype.init = function(props) ...@@ -62,35 +62,36 @@ CBorderBox.prototype.init = function(props)
}*/ }*/
this.setBorders(props); this.setBorders(props);
this.setDimension(1, 1); this.setDimension(1, 1);
this.setContent(); this.setContent();
} }
CBorderBox.prototype.setBorders = function(props) CBorderBox.prototype.setBorders = function(props)
{ {
if(typeof(props) !== "undefined" && props !== null) 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; 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; 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; 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; 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; 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; 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; 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; this.Pr.strikeV = props.strikeV;
} }
...@@ -129,7 +130,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics) ...@@ -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* 25.4/72 * 0.06 ;
var penW = this.Get_CompiledCtrPrp().FontSize*0.02; var penW = this.Get_CompiledCtrPrp().FontSize*0.02;
if(this.Pr.hideTop == false) if(!this.Pr.hideTop)
{ {
var x1 = this.pos.x + x, var x1 = this.pos.x + x,
x2 = this.pos.x + x + this.size.width - penW/2, x2 = this.pos.x + x + this.size.width - penW/2,
...@@ -145,7 +146,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics) ...@@ -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);*/ 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, var x1 = this.pos.x + x,
x2 = this.pos.x + x + this.size.width - penW/2, x2 = this.pos.x + x + this.size.width - penW/2,
...@@ -155,7 +156,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics) ...@@ -155,7 +156,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
pGraphics.drawHorLine(0, y1, x1, x2, penW); pGraphics.drawHorLine(0, y1, x1, x2, penW);
} }
if(this.Pr.hideLeft == false) if(!this.Pr.hideLeft)
{ {
var x1 = this.pos.x + x, var x1 = this.pos.x + x,
y1 = this.pos.y + y, y1 = this.pos.y + y,
...@@ -165,7 +166,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics) ...@@ -165,7 +166,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
pGraphics.drawVerLine(0, x1, y1, y2, penW); 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, var x1 = this.pos.x + x + this.size.width - penW/2,
y1 = this.pos.y + y, y1 = this.pos.y + y,
...@@ -227,7 +228,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics) ...@@ -227,7 +228,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
} }
if(this.bHor) if(this.Pr.strikeH)
{ {
var x1 = this.pos.x + x, var x1 = this.pos.x + x,
x2 = this.pos.x + x + this.size.width - penW, x2 = this.pos.x + x + this.size.width - penW,
...@@ -237,7 +238,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics) ...@@ -237,7 +238,7 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
pGraphics.drawHorLine(0, y1, x1, x2, penW); 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, var x1 = this.pos.x + x + this.size.width/2 - penW/2,
y1 = this.pos.y + y, y1 = this.pos.y + y,
...@@ -247,6 +248,135 @@ CBorderBox.prototype.draw = function(x, y, pGraphics) ...@@ -247,6 +248,135 @@ CBorderBox.prototype.draw = function(x, y, pGraphics)
pGraphics.drawVerLine(0, x1, y1, y2, penW); 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) CBorderBox.prototype.setPosition = function(pos)
{ {
...@@ -594,6 +724,20 @@ CBar.prototype.init = function(props) ...@@ -594,6 +724,20 @@ CBar.prototype.init = function(props)
else if(props.pos === LOCATION_BOT || props.location === LOCATION_BOT) else if(props.pos === LOCATION_BOT || props.location === LOCATION_BOT)
this.Pr.pos = 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") if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined")
this.setCtrPrp(props.ctrPrp); this.setCtrPrp(props.ctrPrp);
} }
...@@ -602,14 +746,8 @@ CBar.prototype.setLocation = function(pos) ...@@ -602,14 +746,8 @@ CBar.prototype.setLocation = function(pos)
this.Pr.pos = pos; this.Pr.pos = pos;
this.RecalcInfo.bProps = true; 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) if(this.RecalcInfo.bProps == true)
{ {
var prp = var prp =
...@@ -624,9 +762,10 @@ CBar.prototype.Resize = function() ...@@ -624,9 +762,10 @@ CBar.prototype.Resize = function()
}; };
this.setCharacter(prp, defaultProps); 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() CBar.prototype.getAscent = function()
{ {
......
...@@ -3,7 +3,12 @@ function CFraction(props) ...@@ -3,7 +3,12 @@ function CFraction(props)
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_FRACTION; this.kind = MATH_FRACTION;
this.type = BAR_FRACTION; this.Pr =
{
type: BAR_FRACTION
};
//this.type = BAR_FRACTION;
this.bHideBar = false; this.bHideBar = false;
CMathBase.call(this); CMathBase.call(this);
...@@ -31,10 +36,10 @@ CFraction.prototype.setType = function(type) ...@@ -31,10 +36,10 @@ CFraction.prototype.setType = function(type)
bLin = type === LINEAR_FRACTION; bLin = type === LINEAR_FRACTION;
if(bBar || bSkew || bLin) // на всякий случай 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(); var num = new CNumerator();
...@@ -42,17 +47,17 @@ CFraction.prototype.setType = function(type) ...@@ -42,17 +47,17 @@ CFraction.prototype.setType = function(type)
this.setDimension(2, 1); this.setDimension(2, 1);
if(this.type == NO_BAR_FRACTION) if(this.Pr.type == NO_BAR_FRACTION)
this.bHideBar = true; this.bHideBar = true;
this.addMCToContent(num, den); this.addMCToContent(num, den);
} }
else if(this.type == SKEWED_FRACTION) else if(this.Pr.type == SKEWED_FRACTION)
{ {
this.setDimension(1, 2); this.setDimension(1, 2);
this.setContent(); this.setContent();
} }
else if(this.type == LINEAR_FRACTION) else if(this.Pr.type == LINEAR_FRACTION)
{ {
this.setDimension(1, 2); this.setDimension(1, 2);
this.setContent(); this.setContent();
...@@ -60,15 +65,15 @@ CFraction.prototype.setType = function(type) ...@@ -60,15 +65,15 @@ CFraction.prototype.setType = function(type)
} }
CFraction.prototype.getType = function() CFraction.prototype.getType = function()
{ {
return this.type; return this.Pr.type;
} }
CFraction.prototype.draw = function(x, y, pGraphics) 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); this.drawBarFraction(x, y, pGraphics);
else if(this.type == SKEWED_FRACTION) else if(this.Pr.type == SKEWED_FRACTION)
this.drawSkewedFraction(x, y, pGraphics); this.drawSkewedFraction(x, y, pGraphics);
else if(this.type == LINEAR_FRACTION) else if(this.Pr.type == LINEAR_FRACTION)
this.drawLinearFraction(x, y, pGraphics); this.drawLinearFraction(x, y, pGraphics);
} }
CFraction.prototype.drawBarFraction = function(x, y, pGraphics) CFraction.prototype.drawBarFraction = function(x, y, pGraphics)
...@@ -234,7 +239,7 @@ CFraction.prototype.getNumerator = function() ...@@ -234,7 +239,7 @@ CFraction.prototype.getNumerator = function()
{ {
var numerator; 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(); numerator = this.elements[0][0].getElement();
else else
numerator = this.elements[0][0]; numerator = this.elements[0][0];
...@@ -245,7 +250,7 @@ CFraction.prototype.getDenominator = function() ...@@ -245,7 +250,7 @@ CFraction.prototype.getDenominator = function()
{ {
var denominator; 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(); denominator = this.elements[1][0].getElement();
else else
denominator = this.elements[0][1]; denominator = this.elements[0][1];
...@@ -254,11 +259,11 @@ CFraction.prototype.getDenominator = function() ...@@ -254,11 +259,11 @@ CFraction.prototype.getDenominator = function()
} }
CFraction.prototype.recalculateSize = function(oMeasure) 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); this.recalculateBarFraction(oMeasure);
else if(this.type == SKEWED_FRACTION) else if(this.Pr.type == SKEWED_FRACTION)
this.recalculateSkewed(oMeasure); this.recalculateSkewed(oMeasure);
else if(this.type == LINEAR_FRACTION) else if(this.Pr.type == LINEAR_FRACTION)
this.recalculateLinear(oMeasure); this.recalculateLinear(oMeasure);
} }
CFraction.prototype.recalculateBarFraction = function(oMeasure) CFraction.prototype.recalculateBarFraction = function(oMeasure)
...@@ -330,7 +335,7 @@ CFraction.prototype.recalculateLinear = function() ...@@ -330,7 +335,7 @@ CFraction.prototype.recalculateLinear = function()
} }
CFraction.prototype.setPosition = function(pos) 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}; this.pos = {x: pos.x, y: pos.y - this.size.ascent};
...@@ -351,7 +356,7 @@ CFraction.prototype.findDisposition = function( mCoord ) ...@@ -351,7 +356,7 @@ CFraction.prototype.findDisposition = function( mCoord )
{ {
var disposition; var disposition;
if(this.type == SKEWED_FRACTION) if(this.Pr.type == SKEWED_FRACTION)
{ {
var mouseCoord = {x: mCoord.x, y: mCoord.y}, var mouseCoord = {x: mCoord.x, y: mCoord.y},
posCurs = {x: null, y: null}, posCurs = {x: null, y: null},
...@@ -416,11 +421,7 @@ CFraction.prototype.findDisposition = function( mCoord ) ...@@ -416,11 +421,7 @@ CFraction.prototype.findDisposition = function( mCoord )
} }
CFraction.prototype.getPropsForWrite = function() CFraction.prototype.getPropsForWrite = function()
{ {
var props = { return this.Pr;
type: this.type
};
return props;
} }
CFraction.prototype.Save_Changes = function(Data, Writer) CFraction.prototype.Save_Changes = function(Data, Writer)
......
function CLimit(props) 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); CMathBase.call(this);
if(props.type === LIMIT_UP || props.type === LIMIT_LOW) if(props.type === LIMIT_UP || props.type === LIMIT_LOW)
this.type = props.type; this.Pr.type = props.type;
this.setDimension(2, 1); this.setDimension(2, 1);
...@@ -15,24 +21,22 @@ function CLimit(props) ...@@ -15,24 +21,22 @@ function CLimit(props)
var oIter = new CMathContent(); var oIter = new CMathContent();
oIter.decreaseArgSize(); oIter.decreaseArgSize();
if(this.type == LIMIT_LOW) if(this.Pr.type == LIMIT_LOW)
this.addMCToContent(oBase, oIter); this.addMCToContent(oBase, oIter);
else if(this.type == LIMIT_UP) else if(this.Pr.type == LIMIT_UP)
this.addMCToContent(oIter, oBase); this.addMCToContent(oIter, oBase);
this.setCtrPrp(props.ctrPrp); this.setCtrPrp(props.ctrPrp);
/// вызов этой функции обязательно в конце
//this.WriteContentsToHistory();
g_oTableId.Add( this, this.Id ); g_oTableId.Add( this, this.Id );
} }
extend(CLimit, CMathBase); extend(CLimit, CMathBase);
CLimit.prototype.getAscent = function() CLimit.prototype.getAscent = function()
{ {
var ascent; var ascent;
if(this.type == LIMIT_LOW) if(this.Pr.type == LIMIT_LOW)
ascent = this.elements[0][0].size.ascent; 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; ascent = this.elements[0][0].size.height + this.dH + this.elements[1][0].size.ascent;
return ascent; return ascent;
...@@ -40,9 +44,9 @@ CLimit.prototype.getAscent = function() ...@@ -40,9 +44,9 @@ CLimit.prototype.getAscent = function()
CLimit.prototype.getFName = function() CLimit.prototype.getFName = function()
{ {
var fName; var fName;
if(this.type == LIMIT_LOW) if(this.Pr.type == LIMIT_LOW)
fName = this.elements[0][0]; fName = this.elements[0][0];
else if(this.type == LIMIT_UP) else if(this.Pr.type == LIMIT_UP)
fName = this.elements[1][0]; fName = this.elements[1][0];
return fName; return fName;
...@@ -50,9 +54,9 @@ CLimit.prototype.getFName = function() ...@@ -50,9 +54,9 @@ CLimit.prototype.getFName = function()
CLimit.prototype.getIterator = function() CLimit.prototype.getIterator = function()
{ {
var iterator; var iterator;
if(this.type == LIMIT_LOW) if(this.Pr.type == LIMIT_LOW)
iterator = this.elements[1][0]; iterator = this.elements[1][0];
else if(this.type == LIMIT_UP) else if(this.Pr.type == LIMIT_UP)
iterator = this.elements[0][0]; iterator = this.elements[0][0];
return iterator; return iterator;
...@@ -63,12 +67,7 @@ CLimit.prototype.setDistance = function() ...@@ -63,12 +67,7 @@ CLimit.prototype.setDistance = function()
} }
CLimit.prototype.getPropsForWrite = function() CLimit.prototype.getPropsForWrite = function()
{ {
var props = return this.Pr;
{
type: this.type
};
return props;
} }
CLimit.prototype.Save_Changes = function(Data, Writer) CLimit.prototype.Save_Changes = function(Data, Writer)
{ {
...@@ -106,10 +105,14 @@ CLimit.prototype.Get_Id = function() ...@@ -106,10 +105,14 @@ CLimit.prototype.Get_Id = function()
{ {
return this.Id; return this.Id;
} }
function CMathFunc(props) function CMathFunc(props)
{ {
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_FUNCTION; this.kind = MATH_FUNCTION;
this.Pr = {};
CMathBase.call(this); CMathBase.call(this);
this.setDimension(1, 2); this.setDimension(1, 2);
...@@ -117,8 +120,6 @@ function CMathFunc(props) ...@@ -117,8 +120,6 @@ function CMathFunc(props)
this.setCtrPrp(props.ctrPrp); this.setCtrPrp(props.ctrPrp);
/// вызов этой функции обязательно в конце
//this.WriteContentsToHistory();
g_oTableId.Add( this, this.Id ); g_oTableId.Add( this, this.Id );
} }
extend(CMathFunc, CMathBase); extend(CMathFunc, CMathBase);
......
...@@ -5103,7 +5103,8 @@ CMathContent.prototype = ...@@ -5103,7 +5103,8 @@ CMathContent.prototype =
{ {
if(!this.bRoot) 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.applyArgSize(oWPrp);
this.ParaMath.ApplyArgSize(oWPrp, this.argSize); this.ParaMath.ApplyArgSize(oWPrp, this.argSize);
...@@ -5242,7 +5243,8 @@ CMathContent.prototype = ...@@ -5242,7 +5243,8 @@ CMathContent.prototype =
{ {
pGraphics.b_color1(0,0,0,255); 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.applyArgSize(oWPrp);
this.ParaMath.ApplyArgSize(oWPrp, this.argSize); this.ParaMath.ApplyArgSize(oWPrp, this.argSize);
...@@ -6289,7 +6291,7 @@ CMathContent.prototype = ...@@ -6289,7 +6291,7 @@ CMathContent.prototype =
var TextPr; var TextPr;
if(this.IsPlaceholder()) if(this.IsPlaceholder())
TextPr = this.Parent.getCtrPrp(); TextPr = this.Parent.Get_CtrPrp();
else else
TextPr = this.content[pos].Get_TextPr(ContentPos, Depth + 1); TextPr = this.content[pos].Get_TextPr(ContentPos, Depth + 1);
...@@ -6301,7 +6303,7 @@ CMathContent.prototype = ...@@ -6301,7 +6303,7 @@ CMathContent.prototype =
if(this.IsPlaceholder()) if(this.IsPlaceholder())
{ {
TextPr = this.Parent.getCtrPrp(); TextPr = this.Parent.Get_CompiledCtrPrp();
} }
else if ( true === this.bSelectionUse || bAll == true) else if ( true === this.bSelectionUse || bAll == true)
{ {
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
var DIV_CENT = 0.1386; var DIV_CENT = 0.1386;
var StartTextElement = 0x2B1A; // Cambria Math var StartTextElement = 0x2B1A; // Cambria Math
// TODO // TODO
...@@ -279,6 +281,8 @@ CMathText.prototype = ...@@ -279,6 +281,8 @@ CMathText.prototype =
var X = this.pos.x + x, var X = this.pos.x + x,
Y = this.pos.y + y; Y = this.pos.y + y;
//console.log(String.fromCharCode(this.getCode()) + ": X " + X);
/*var tx = 0; /*var tx = 0;
var ty = 0; var ty = 0;
......
...@@ -202,6 +202,3 @@ var extend = function(Child, Parent) ...@@ -202,6 +202,3 @@ var extend = function(Child, Parent)
Child.superclass = Parent.prototype; Child.superclass = Parent.prototype;
} }
// default Txt Prp
// argSize
This diff is collapsed.
This diff is collapsed.
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