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