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

1. gaps for arithmetic signs

2. поправила баг с updateCursor

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53441 954022d7-b5bf-4e40-9824-e11837661b57
parent f656d523
......@@ -106,13 +106,6 @@ CMathBase.prototype =
return ctrPrp;
},
getShiftCenter: function(oMeasure, font)
{
oMeasure.SetFont(font);
var metrics = oMeasure.Measure2Code(8727); // "+"
return 0.6*metrics.Height;
},
// для управляющих символов в приоритете GetFirstPrp
// если первый элемент - мат объект, то берутся его CtrPrp
getPrpToControlLetter: function()
......
......@@ -52,7 +52,7 @@ CDegree.prototype.recalculateSup = function(oMeasure)
var descIter = iter.height - iter.ascent;
var ctrPrp = this.getCtrPrp(); // выставить потом размер шрифта для итератора
var shCenter = this.getShiftCenter(oMeasure, ctrPrp);
var shCenter = this.Composition.GetShiftCenter(oMeasure, ctrPrp);
var upper = 0;
......@@ -93,7 +93,7 @@ CDegree.prototype.recalculateSubScript = function(oMeasure)
shiftCenter = 0.5*DIV_CENT*FontSize;*/
var ctrPrp = this.getCtrPrp(); // выставить потом размер шрифта для итератора
var shCenter = this.getShiftCenter(oMeasure, ctrPrp);
var shCenter = this.Composition.GetShiftCenter(oMeasure, ctrPrp);
var low = 0;
if(iter.ascent - shCenter > 2/3*base.height)
......@@ -317,7 +317,7 @@ CIterators.prototype.setDistanceIters = function(oMeasure)
shCent = DIV_CENT*FontSize;*/
var ctrPrp = this.getCtrPrp();
var shCenter = this.getShiftCenter(oMeasure, ctrPrp);
var shCenter = this.Composition.GetShiftCenter(oMeasure, ctrPrp);
var upDesc = upIter.height - upIter.ascent + shCenter,
lowAsc = lowIter.ascent - shCenter;
......@@ -432,7 +432,7 @@ CDegreeSubSup.prototype.init_2 = function(props, oBase)
CDegreeSubSup.prototype.recalculateSize = function(oMeasure)
{
var ctrPrp = this.getCtrPrp();
var shCenter = this.getShiftCenter(oMeasure, ctrPrp);
var shCenter = this.Composition.GetShiftCenter(oMeasure, ctrPrp);
var width = 0, height = 0,
ascent = 0;
......
......@@ -277,7 +277,7 @@ CFraction.prototype.recalculateBarFraction = function(oMeasure)
var width = num.width > den.width ? num.width : den.width;
var height = num.height + den.height;
var ascent = num.height + this.getShiftCenter(oMeasure, ctrPrp);
var ascent = num.height + this.Composition.GetShiftCenter(oMeasure, ctrPrp);
//var ascent = num.height;
this.size = {width: width, height: height, ascent: ascent};
......@@ -288,7 +288,7 @@ CFraction.prototype.recalculateSkewed = function(oMeasure)
this.gapSlash = 5.011235894097222 * ctrPrp.FontSize/36;
var _width = this.elements[0][0].size.width + this.gapSlash + this.elements[0][1].size.width;
var _height = this.elements[0][0].size.height + this.elements[0][1].size.height;
var _ascent = this.elements[0][0].size.height + this.getShiftCenter(oMeasure, ctrPrp);
var _ascent = this.elements[0][0].size.height + this.Composition.GetShiftCenter(oMeasure, ctrPrp);
this.size = {width: _width, height: _height, ascent: _ascent};
}
......
This diff is collapsed.
......@@ -78,10 +78,10 @@ CMathText.prototype =
{
add: function(code)
{
if(code == 42) // "*"
code = 8727;
else if(code == 45) // "-"
code = 8722;
if(code == 0x2A) // "*"
code = 0x2217;
else if(code == 0x2D) // "-"
code = 0x2212;
this.value = code;
},
......@@ -145,6 +145,10 @@ CMathText.prototype =
return code;
},
getCodeChr: function()
{
return this.value;
},
fillPlaceholders: function()
{
this.typeObj = MATH_PLACEHOLDER;
......
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