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

объединила классы (дробь, радикал, степень)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49163 954022d7-b5bf-4e40-9824-e11837661b57
parent 1c244bc3
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
var MATH_FRACTION = 0;
var MATH_DEGREE = 1;
var MATH_DEGREESubSup = 2;
var MATH_RADICAL = 3;
var MATH_NARY = 4;
var MATH_DELIMITER = 5;
var MATH_GROUP_CHARACTER = 6;
var MATH_FUNCTION = 7;
var MATH_ACCENT = 8;
var MATH_BORDER_BOX = 9;
var MATH_LIMIT = 10;
var MATH_MATRIX = 11;
var MATH_BOX = 12;
var BAR_FRACTION = 0;
var SKEWED_FRACTION = 1;
var LINEAR_FRACTION = 2;
var NO_BAR_FRACTION = 3;
var SUPERSCRIPT = 1;
var SUBSCRIPT = -1;
var SubSup = 1;
var PreSubSup = -1;
var SQUARE_RADICAL = 0;
var DEGREE_RADICAL = 1;
var LIMIT_LOW = 0;
var LIMIT_UP = 1;
\ No newline at end of file
......@@ -46,78 +46,74 @@ CLogarithm.prototype.getArgument = function()
return this.elements[0][1];
}
function CMinimaxFunc()
function CLimLowUp()
{
CMathBase.call(this);
}
extend(CMinimaxFunc, CMathBase);
CMinimaxFunc.prototype.init = function()
extend(CLimLowUp, CMathBase);
CLimLowUp.prototype.init = function(props)
{
this.type = props.type;
this.setDimension(2, 1);
var oBase = new CMathContent();
//oBase.mergeTxtPrp({Italic: false});
oBase.setOwnTPrp({Italic: false});
var oIter = new CMathContent();
oIter.setReduct(DEGR_REDUCT);
this.addMCToContent(oBase, oIter);
if(props.type == LIMIT_LOW)
this.addMCToContent(oBase, oIter);
else if(props.type == LIMIT_UP)
this.addMCToContent(oIter, oBase);
}
CMinimaxFunc.prototype.getCenter = function()
CLimLowUp.prototype.getCenter = function()
{
return this.elements[0][0].size.center;
}
CMinimaxFunc.prototype.getBase = function()
CLimLowUp.prototype.getFName = function()
{
return this.elements[0][0];
}
CMinimaxFunc.prototype.getIterator = function()
CLimLowUp.prototype.getIterator = function()
{
return this.elements[1][0];
}
CMinimaxFunc.prototype.old_setDistance = function()
{
var iter = this.elements[1][0].size,
ascent = iter.center + this.params.font.metrics.Placeholder.Height*DIV_CENTER;
this.dH = this.params.font.metrics.Placeholder.Height - ascent;
this.dW = 0;
//this.dH = this.params.font.FontSize/16*g_dKoef_pt_to_mm;
}
CMinimaxFunc.prototype.setDistance = function()
CLimLowUp.prototype.setDistance = function()
{
this.dH = 0.03674768518518519*this.getTxtPrp().FontSize;
}
function CMinimax()
function old_CMinimax()
{
CSubMathBase.call(this);
}
extend(CMinimax, CSubMathBase);
CMinimax.prototype.init = function()
extend(old_CMinimax, CSubMathBase);
old_CMinimax.prototype.init = function()
{
this.setDimension(1, 2);
var oFunc = new CMinimaxFunc();
var oFunc = new old_CMinimaxFunc();
oFunc.init();
var oArg = new CMathContent();
this.addMCToContent(oFunc, oArg);
}
CMinimax.prototype.getFunction = function()
old_CMinimax.prototype.getFName = function()
{
return this.elements[0][0].getBase();
}
CMinimax.prototype.getIterator = function()
old_CMinimax.prototype.getIterator = function()
{
return this.elements[0][0].getIterator();
}
CMinimax.prototype.getArgument = function()
old_CMinimax.prototype.getArgument = function()
{
return this.elements[0][1];
}
CMinimax.prototype.setDistance = function()
old_CMinimax.prototype.setDistance = function()
{
this.dW = this.getTxtPrp().FontSize/6*g_dKoef_pt_to_mm;
this.dH = 0;
......@@ -140,7 +136,7 @@ CMathFunc.prototype.setDistance = function()
{
this.dW = this.getTxtPrp().FontSize/6*g_dKoef_pt_to_mm;
}
CMathFunc.prototype.getFunction = function()
CMathFunc.prototype.getFName = function()
{
return this.elements[0][0];
}
......
......@@ -11,14 +11,26 @@
// 0 - итраторы по прямой линии
// 1 - итераторы расположены также, как у степени
function CNary()
{
}
extend(CNary, CSubMathBase);
CNary.prototype.init = function(props)
{
this.typeSign = props.sign;
this.limLoc = props.limLoc;
this.supHide = props.supHide;
this.subHide = props.subHide;
}
function CNary()
function old_CNary()
{
CSubMathBase.call(this);
}
extend(CNary, CSubMathBase);
CNary.prototype.init = function(index, orderType, iterType)
extend(old_CNary, CSubMathBase);
old_CNary.prototype.init = function(index, orderType, iterType)
{
this.setDimension(1, 2);
......@@ -96,19 +108,19 @@ CNary.prototype.init = function(index, orderType, iterType)
this.addMCToContent(base, arg);
}
CNary.prototype.setDistance = function()
old_CNary.prototype.setDistance = function()
{
this.dW = this.getTxtPrp().FontSize/36*2.45;
}
CNary.prototype.getBase = function()
old_CNary.prototype.getBase = function()
{
return this.elements[0][1];
}
CNary.prototype.getUpperIterator = function()
old_CNary.prototype.getUpperIterator = function()
{
return this.elements[0][0].getUpperIterator();
}
CNary.prototype.getLowerIterator = function()
old_CNary.prototype.getLowerIterator = function()
{
return this.elements[0][0].getLowerIterator();
}
......
This diff is collapsed.
......@@ -193,6 +193,7 @@
<script type="text/javascript" src = "Math/operators.js"></script>
<script type="text/javascript" src = "Math/drawingUnion.js"></script>
<script type="text/javascript" src = "Math/borderBox.js"></script>
<script type="text/javascript" src = "Math/mathTypes.js"></script>
<!---->
......
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