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

trigonometric function (new)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48152 954022d7-b5bf-4e40-9824-e11837661b57
parent e0bb9f95
......@@ -80,15 +80,17 @@ CMathBase.prototype =
txtPrp.Merge(this.textPrp);
txtPrp.FontSize *= this.reduct;
return txtPrp;
},
getTxtPrp_2: function()
/*getTxtPrp_2: function()
{
var txtPrp = this.getTxtPrp();
txtPrp.FontSize *= this.reduct;
return txtPrp;
},
},*/
setComposition: function(Compos)
{
this.Composition = Compos;
......
......@@ -18,12 +18,12 @@ CBarFraction.prototype.init = function()
}
CBarFraction.prototype.getCenter = function()
{
var penW = this.getTxtPrp_2().FontSize* 25.4/96 * 0.08 /2;
var penW = this.getTxtPrp().FontSize* 25.4/96 * 0.08 /2;
return this.elements[0][0].size.height + penW;
}
CBarFraction.prototype.draw = function()
{
var penW = this.getTxtPrp_2().FontSize* this.reduct* 25.4/96 * 0.08;
var penW = this.getTxtPrp().FontSize* this.reduct* 25.4/96 * 0.08;
var x1 = this.pos.x,
x2 = this.pos.x + this.size.width,
......@@ -73,7 +73,7 @@ CNumerator.prototype.init = function()
CNumerator.prototype.recalculateSize = function()
{
var arg = this.elements[0][0].size;
var txtPrp = this.getTxtPrp_2();
var txtPrp = this.getTxtPrp();
var Descent = arg.height - arg.ascent; // baseLine
var gap = 7.832769097222222 * txtPrp.FontSize/36,
......@@ -177,7 +177,7 @@ CDenominator.prototype.init = function()
CDenominator.prototype.recalculateSize = function()
{
var arg = this.elements[0][0].size;
var txtPrp = this.getTxtPrp_2();
var txtPrp = this.getTxtPrp();
var gap = 7.832769097222222 * txtPrp.FontSize/36,
Ascent = arg.ascent,
......
......@@ -150,10 +150,16 @@ CMinimax.prototype.setDistance = function()
function CMathFunc()
{
CMathBase.call(this, 1,2);
CMathBase.call(this);
}
extend(CMathFunc, CMathBase);
CMathFunc.prototype.setContent = function()
CMathFunc.prototype.init = function()
{
this.setDimension(1, 2);
this.setContent();
this.elements[0][0].mergeTxtPrp({Italic: false}); // trigonometrical function
}
CMathFunc.prototype.old_setContent = function()
{
var oFunc = new CMathContent();
var GParms = Common_CopyObj(this.params);
......@@ -169,8 +175,7 @@ CMathFunc.prototype.setContent = function()
}
CMathFunc.prototype.setDistance = function()
{
this.dW = this.params.font.FontSize/6*g_dKoef_pt_to_mm;
this.dH = 0;
this.dW = this.getTxtPrp().FontSize/6*g_dKoef_pt_to_mm;
}
CMathFunc.prototype.getFunction = function()
{
......
This diff is collapsed.
......@@ -20,7 +20,7 @@ CMathTextPrp.prototype =
Merge: function(prp)
{
if(prp.FontFamily !== undefined)
this.FontFamily = prp.FontFamily;
this.FontFamily = Common_CopyObj(prp.FontFamily);
if(prp.FontSize !== undefined)
this.FontSize = prp.FontSize;
......@@ -31,6 +31,13 @@ CMathTextPrp.prototype =
if(prp.Italic !== undefined)
this.Italic = prp.Italic;
},
Set: function(prp)
{
this.FontFamily = Common_CopyObj(prp.FontFamily);
this.FontSize = prp.FontSize;
this.Bold = prp.Bold;
this.Italic = prp.Italic;
}
}
......@@ -130,13 +137,6 @@ CMathText.prototype =
return txtPrp;
},
getTxtPrp_Out: function()
{
var txtPrp = this.Parent.getTxtPrp();
txtPrp.Merge(this.TextPrp);
return txtPrp;
},
setTxtPrp: function(txtPrp)
{
this.textPrp.Set(txtPrp);
......
......@@ -548,123 +548,6 @@ CDelimiter.prototype.init_2 = function(params, base)
this.alignVer(2, 0.5);
}
}
CDelimiter.prototype.old_setContent = function(arg)
{
var operator1, operator2,
loc1, loc2;
if(this.loc == 0)
loc1 = 0;
else if(this.loc == 1)
loc2 = 1;
else if(this.loc == 2)
loc1 = 2;
else if(this.loc == 3)
loc2 = 3;
else if(this.loc == 4)
{
loc1 = 2;
loc2 = 3;
}
else
{
loc1 = 0;
loc2 = 1;
}
if(this.type == 0)
{
operator1 = new COperatorParenthesis();
operator2 = new COperatorParenthesis();
}
else if(this.type == 1)
{
operator1 = new COperatorBracket();
operator2 = new COperatorBracket();
}
else if(this.type == 2)
{
operator1 = new CSquareBracket();
operator2 = new CSquareBracket();
}
else if(this.type == 3)
{
operator1 = new COperatorAngleBracket();
operator2 = new COperatorAngleBracket();
}
else if(this.type == 4)
{
operator1 = new CHalfSquareBracket();
operator2 = new CHalfSquareBracket();
}
else if(this.type == 5)
{
operator1 = new COperatorLine();
operator2 = new COperatorLine();
}
else if(this.type == 6)
{
operator1 = new COperatorDoubleLine();
operator2 = new COperatorDoubleLine();
}
else
{
operator1 = new CWhiteSquareBracket();
operator2 = new CWhiteSquareBracket();
}
var params1 = Common_CopyObj(this.params),
params2 = Common_CopyObj(this.params);
operator1.init(params1);
operator1.setLocation(loc1, this.turn1);
operator2.init(params2);
operator2.setLocation(loc2, this.turn2);
var argument;
if(arg !== null && typeof(arg)!== "undefined")
argument = arg;
else
{
argument = new CMathContent();
argument.init(this.params);
argument.relate(this);
argument.fillPlaceholders();
}
this.base = argument;
if(this.loc == 0 || this.loc == 2)
{
CDelimiter.superclass.setContent.call(this, operator1, argument);
}
else if(this.loc == 1 || this.loc == 3)
{
CDelimiter.superclass.setContent.call(this, argument, operator2);
}
else
{
CDelimiter.superclass.setContent.call(this, operator1, argument, operator2);
}
//выравнивание для случая когда центр смещен (не середина), для вложенных дробей и т.п.
if(this.loc == 2)
{
this.alignVer(0, 0.5);
}
else if(this.loc == 3)
{
this.alignVer(1, 0.5);
}
if(this.loc == 4)
{
this.alignVer(0, 0.5);
this.alignVer(2, 0.5);
}
}
CDelimiter.prototype.recalculateSize = function()
{
var width, height, center;
......@@ -2968,15 +2851,6 @@ CSeparatorDelimiter.prototype.init = function(type, column)
};
this.init_2(params, base);
}
CSeparatorDelimiter.prototype.old_setContent = function()
{
var arg = new CSeparator(this.column);
arg.init(this.params);
arg.relate(this);
arg.fillPlaceholders();
CSeparatorDelimiter.superclass.setContent.call(this, arg);
}
CSeparatorDelimiter.prototype.mouseMove = function(mCoord)
{
var elem = this.findDisposition( mCoord);
......
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