Commit a38fcf86 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@49771 954022d7-b5bf-4e40-9824-e11837661b57
parent 6722aa1e
This diff is collapsed.
......@@ -57,6 +57,7 @@ CLimit.prototype.init = function(props)
this.setDimension(2, 1);
var oBase = new CMathContent();
oBase.setOwnTPrp({Italic: false});
var oIter = new CMathContent();
......@@ -73,7 +74,7 @@ CLimit.prototype.getCenter = function()
if(this.type == LIMIT_LOW)
center = this.elements[0][0].size.center;
else if(this.type == LIMIT_UP)
center = this.elements[0][0].size.height + this.elements[1][0].size.center;
center = this.elements[0][0].size.height + this.dH + this.elements[1][0].size.center;
return center;
}
......
......@@ -17,7 +17,6 @@ CLogarithm.prototype.setContent = function()
oBase.addText("log");
//oBase.setContent.apply(oBase, NameFunctions.minimax[3] );
var oFunc = new CDegreeOrdinary(-1);
oFunc.init(this.params);
oFunc.relate(this);
......
......@@ -42,8 +42,6 @@ function mathElem(_val)
//TODO
//переделать/продумать DotIndef, т.к. при перетаскивании из одного места в другое флаг DotIndef может измениться для другого контента
//TODO
//сделать более понятным индефикатор bMText
//TODO
//пересмотреть this.dW и this.dH
......@@ -55,37 +53,16 @@ function mathElem(_val)
//сделать, чтобы курсор выставлялся только, где это действительно необходимо
//в качетве позиции для контента передавать положение baseLine для него
//TODO
//indefSize убрать
//TODO
//переделать CDegree
//TODO
//убрать CSymbol
//TODO
//пересмотреть/убрать CSubMathBase
//TODO
//переделать степень для случая с 2-мя итераторами : посмотреть как сделано для n-арного оператора
//TODO
//сделать у радикала степень
// TODO Refactoring
// 1. переделать mouseMove (вызов из this.SelectContent, а не из this.Root, далее если state == false, подниматься наверх)
// 1. (!!) повтор IsIncline, IsHighElement
// 2. (!!) переделать add / add_mathComponent / addText / addLetter
// 3. home/end if( IsTarget() )
// 4. relate => сделать 2 функции : одну установить базовый контент корнем(Root) и функцию установить родительский класс (setParent)
// 5. update_widthContent добавить в recalculateSize (убрать recalculate в CMathContent)
// 6. (скорее всего) убрать coordWOGaps
// 7. убрать getMetricsLetter
// 8. setFont и updateTextPrp переделать (сделать, чтобы font менялся для заселекченной части контента)
// 1.
// 2. (!!) повтор IsIncline, IsHighElement
function CMathContent()
......@@ -135,6 +112,12 @@ CMathContent.prototype =
this.g_mContext = new dist(0,0,0,0);
this.content.push( new mathElem(new CEmpty(), new dist(0,0,0,0), 0) );
},
setPrp: function(prp) //текстовые настройки
{
this.OwnTPrp.Merge(prp);
for(var i = 0; i < this.content.length; i++)
this.content[i].value.setOwnTPrp(prp);
},
setTxtPrp: function(txtPrp)
{
this.TxtPrp.Merge(txtPrp);
......@@ -3975,9 +3958,18 @@ CMathContent.prototype =
arg2.addTxt("θ");
break;
case 152:
var diac = this.addMComponent(15);
/*var diac = this.addMComponent(15);
diac.init(3);
diac.fillPlaceholders();
diac.fillPlaceholders();*/
var delim = this.addMComponent(MATH_GROUP_CHARACTER);
var props =
{
chr: {value: "."},
location: LOCATION_TOP,
justif: VJUST_BOT
};
delim.init(props);
delim.fillPlaceholders();
break;
case 153:
var diac = this.addMComponent(15);
......@@ -4060,8 +4052,46 @@ CMathContent.prototype =
delim.fillPlaceholders();
break;
case 165:
var lim = this.addMComponent(MATH_LIMIT);
var props =
{
type: LIMIT_UP
};
lim.init(props);
var iter = lim.getIterator();
iter.fillPlaceholders();
var func = lim.getFName();
func.setPrp({Italic: true});
var grCh = func.addMComponent(MATH_GROUP_CHARACTER);
var props2 =
{
chr: {type: BRACKET_CURLY_TOP},
location: LOCATION_TOP,
justif: VJUST_BOT
};
grCh.init(props2);
grCh.fillPlaceholders();
break;
case 166:
var lim = this.addMComponent(MATH_LIMIT);
var props =
{
type: LIMIT_LOW
};
lim.init(props);
var iter = lim.getIterator();
iter.fillPlaceholders();
var func = lim.getFName();
func.setPrp({Italic: true});
var grCh = func.addMComponent(MATH_GROUP_CHARACTER);
var props2 =
{
chr: {type: BRACKET_CURLY_BOTTOM},
location: LOCATION_BOT,
justif: VJUST_TOP
};
grCh.init(props2);
grCh.fillPlaceholders();
break;
case 167:
var delim = this.addMComponent(MATH_GROUP_CHARACTER);
......
......@@ -74,10 +74,10 @@ var ARROW_LR = 20;
var HALF_ARROW_LEFT = 21;
var HALF_ARROW_RIGHT = 22;
var DELIMITER_TURN_0 = 0;
var DELIMITER_TURN_180 = 1;
var DELIMITER_TURN_MIRROR_0 = 2;
var DELIMITER_TURN_MIRROR_180 = 3;
var TURN_0 = 0;
var TURN_180 = 1;
var TURN_MIRROR_0 = 2;
var TURN_MIRROR_180 = 3;
var DELIMITER_SHAPE_MATH = 0;
var DELIMITER_SHAPE_CENTERED = 1;
......@@ -85,6 +85,19 @@ var DELIMITER_SHAPE_CENTERED = 1;
var LIMIT_LOW = 0;
var LIMIT_UP = 1;
var ACCENT_ONE_DOT = 0;
var ACCENT_TWO_DOTS = 1;
var ACCENT_THREE_DOTS = 2;
var ACCENT_GRAVE = 3;
var ACCENT_ACUTE = 4;
var ACCENT_CIRCUMFLEX = 5;
var ACCENT_COMB_CARON = 6;
var ACCENT_LINE = 7;
var ACCENT_DOUBLE_LINE = 8;
var SINGLE_LINE = 9;
var DOUBLE_LINE = 10;
var MATH_TEXT = 11;
var MATRIX_CENTER = 0;
var MATRIX_TOP = 1;
var MATRIX_BOTTOM = 2;
\ No newline at end of file
......@@ -18,6 +18,7 @@ function CGlyphOperator()
this.penW = 1; // px
this.TxtPrp = new CMathTextPrp();
this.bGlyph = true;
}
CGlyphOperator.prototype.init = function(props)
......@@ -1017,7 +1018,7 @@ function GetGlyph(chr, location)
var props =
{
location: location,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.init(props);
}
......@@ -1027,7 +1028,7 @@ function GetGlyph(chr, location)
var props =
{
location: location,
turn: DELIMITER_TURN_180
turn: TURN_180
};
operator.init(props);
}
......@@ -1037,7 +1038,7 @@ function GetGlyph(chr, location)
var props =
{
location: location,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.init(props);
}
......@@ -1047,7 +1048,7 @@ function GetGlyph(chr, location)
var props =
{
location: location,
turn: DELIMITER_TURN_180
turn: TURN_180
};
operator.init(props);
}
......@@ -1057,7 +1058,7 @@ function GetGlyph(chr, location)
var props =
{
location: location,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.init(props);
}
......@@ -1067,7 +1068,7 @@ function GetGlyph(chr, location)
var props =
{
location: location,
turn: DELIMITER_TURN_180
turn: TURN_180
};
operator.init(props);
}
......@@ -1078,7 +1079,7 @@ function GetGlyph(chr, location)
{
location: location,
//location: DELIMITER_LOCATION_LEFT,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.init(props);
}
......@@ -1089,7 +1090,7 @@ function GetGlyph(chr, location)
{
//location: DELIMITER_LOCATION_RIGHT,
location: location,
turn: DELIMITER_TURN_180
turn: TURN_180
};
operator.init(props);
}
......@@ -1100,7 +1101,7 @@ function GetGlyph(chr, location)
{
location: location,
//location: DELIMITER_LOCATION_LEFT,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.init(props);
}
......@@ -1111,7 +1112,7 @@ function GetGlyph(chr, location)
{
//location: DELIMITER_LOCATION_LEFT,
location: location,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.init(props);
}
......@@ -1122,7 +1123,7 @@ function GetGlyph(chr, location)
{
//location: DELIMITER_LOCATION_LEFT,
location: location,
turn: DELIMITER_TURN_180
turn: TURN_180
};
operator.init(props);
}
......@@ -1133,7 +1134,7 @@ function GetGlyph(chr, location)
{
//location: DELIMITER_LOCATION_LEFT,
location: location,
turn: DELIMITER_TURN_MIRROR_0
turn: TURN_MIRROR_0
};
operator.init(props);
}
......@@ -1144,7 +1145,7 @@ function GetGlyph(chr, location)
{
//location: DELIMITER_LOCATION_LEFT,
location: location,
turn: DELIMITER_TURN_MIRROR_180
turn: TURN_MIRROR_180
};
operator.init(props);
}
......@@ -1155,7 +1156,7 @@ function GetGlyph(chr, location)
{
location: location,
//location: DELIMITER_LOCATION_LEFT,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.init(props);
}
......@@ -1166,7 +1167,7 @@ function GetGlyph(chr, location)
{
//location: DELIMITER_LOCATION_LEFT,
location: location,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.init(props);
}
......@@ -1177,14 +1178,17 @@ function GetGlyph(chr, location)
{
//location: DELIMITER_LOCATION_LEFT,
location: location,
turn: DELIMITER_TURN_180
turn: TURN_180
};
operator.init(props);
}
else if( chr.value === "" || chr.type === BRACKET_EMPTY)
operator = -1;
else
operator = -1;
{
operator = new CMathText();
operator.add(chr.value.charCodeAt(0));
}
return operator;
......@@ -1201,7 +1205,7 @@ function GetGlyph_GrChr(chr, location)
var props =
{
location: LOCATION_BOT,
turn: DELIMITER_TURN_MIRROR_0
turn: TURN_MIRROR_0
};
operator.init(props);
}
......@@ -1212,7 +1216,7 @@ function GetGlyph_GrChr(chr, location)
var props =
{
location: location,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.init(props);
}
......@@ -1222,7 +1226,7 @@ function GetGlyph_GrChr(chr, location)
var props =
{
location: location,
turn: DELIMITER_TURN_MIRROR_0
turn: TURN_MIRROR_0
};
operator.init(props);
}
......@@ -1232,7 +1236,7 @@ function GetGlyph_GrChr(chr, location)
var props =
{
location: location,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.init(props);
}
......@@ -1242,7 +1246,7 @@ function GetGlyph_GrChr(chr, location)
var props =
{
location: location,
turn: DELIMITER_TURN_180
turn: TURN_180
};
operator.init(props);
}
......@@ -1252,7 +1256,7 @@ function GetGlyph_GrChr(chr, location)
var props =
{
location: location,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.init(props);
}
......@@ -1262,7 +1266,7 @@ function GetGlyph_GrChr(chr, location)
var props =
{
location: location,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.init(props);
}
......@@ -1272,10 +1276,15 @@ function GetGlyph_GrChr(chr, location)
var props =
{
location: location,
turn: DELIMITER_TURN_180
turn: TURN_180
};
operator.init(props);
}
else
{
operator = new CMathText();
operator.add(chr.value.charCodeAt(0));
}
return operator;
}
......@@ -1575,7 +1584,7 @@ CBaseDelimiter.prototype.getOperator = function(chr)
var props =
{
location: DELIMITER_LOCATION_LEFT,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.ini(props);
}
......@@ -1585,7 +1594,7 @@ CBaseDelimiter.prototype.getOperator = function(chr)
var props =
{
location: DELIMITER_LOCATION_RIGHT,
turn: DELIMITER_TURN_180
turn: TURN_180
};
operator.ini(props);
}
......@@ -1595,7 +1604,7 @@ CBaseDelimiter.prototype.getOperator = function(chr)
var props =
{
location: DELIMITER_LOCATION_LEFT,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.ini(props);
}
......@@ -1605,7 +1614,7 @@ CBaseDelimiter.prototype.getOperator = function(chr)
var props =
{
location: DELIMITER_LOCATION_RIGHT,
turn: DELIMITER_TURN_180
turn: TURN_180
};
operator.ini(props);
}
......@@ -1615,7 +1624,7 @@ CBaseDelimiter.prototype.getOperator = function(chr)
var props =
{
location: DELIMITER_LOCATION_LEFT,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.ini(props);
}
......@@ -1625,7 +1634,7 @@ CBaseDelimiter.prototype.getOperator = function(chr)
var props =
{
location: DELIMITER_LOCATION_RIGHT,
turn: DELIMITER_TURN_180
turn: TURN_180
};
operator.ini(props);
}
......@@ -1635,7 +1644,7 @@ CBaseDelimiter.prototype.getOperator = function(chr)
var props =
{
location: DELIMITER_LOCATION_LEFT,
turn: DELIMITER_TURN_0
turn: TURN_0
};
operator.ini(props);
}
......@@ -1645,7 +1654,7 @@ CBaseDelimiter.prototype.getOperator = function(chr)
var props =
{
location: DELIMITER_LOCATION_RIGHT,
turn: DELIMITER_TURN_180
turn: TURN_180
};
operator.ini(props);
}
......@@ -4349,6 +4358,7 @@ COperator.prototype.draw = function()
}
COperator.prototype.fixSize = function(measure)
{
if(this.glyph !== -1)
{
this.glyph.fixSize(measure);
......
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