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

1. В предыдщей заливке поправила размеры тильды и координаты для отрисовки...

1. В предыдщей заливке поправила размеры тильды и координаты для отрисовки тильды (не учитывлся коэффициент для перевода координат в миллиметры)
2. Поправила баг на Selection_Remove
3. Поправила баг : не учитывались Gaps у Child-контента для мат объектов (это работает для мат объектов с одним контентом)
4. Поправила баг : неправильно выставлялась позиция для accent, т.е. неправильно вычислялся align ( когда были Gaps у Child-контента )

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57014 954022d7-b5bf-4e40-9824-e11837661b57
parent 9521fde8
...@@ -1070,12 +1070,14 @@ CAccent.prototype.setPosition = function(pos) ...@@ -1070,12 +1070,14 @@ CAccent.prototype.setPosition = function(pos)
this.pos.x = pos.x; this.pos.x = pos.x;
this.pos.y = pos.y - this.size.ascent; this.pos.y = pos.y - this.size.ascent;
var alignOp = (this.size.width - this.operator.size.width)/2, var width = this.size.width - this.GapLeft - this.GapRight;
alignCnt = (this.size.width - this.elements[0][0].size.width)/2;
var alignOp = (width - this.operator.size.width)/2,
alignCnt = (width- this.elements[0][0].size.width)/2;
var PosOper = new CMathPosition(); var PosOper = new CMathPosition();
PosOper.x = this.pos.x + this.GapLeft + alignOp; PosOper.x = this.pos.x + this.GapLeft + alignOp;
PosOper.y = this.pos.y + this.shiftX_2; PosOper.y = this.pos.y + this.shiftX_2;
//PosOper.y = this.pos.y + this.size.ascent - this.shiftX; //PosOper.y = this.pos.y + this.size.ascent - this.shiftX;
...@@ -1144,6 +1146,7 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure) ...@@ -1144,6 +1146,7 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure)
height = base.size.height + this.operator.size.height + this.gap, height = base.size.height + this.operator.size.height + this.gap,
ascent = this.operator.size.height + this.gap + this.elements[0][0].size.ascent; ascent = this.operator.size.height + this.gap + this.elements[0][0].size.ascent;
this.size = {height: height, width: width, ascent: ascent}; this.size = {height: height, width: width, ascent: ascent};
} }
CAccent.prototype.getBase = function() CAccent.prototype.getBase = function()
......
...@@ -1444,7 +1444,7 @@ CMathBase.prototype = ...@@ -1444,7 +1444,7 @@ CMathBase.prototype =
var start_X = this.SelectStart.X, var start_X = this.SelectStart.X,
start_Y = this.SelectStart.Y; start_Y = this.SelectStart.Y;
if(start_X !== -1 && start_Y !== -1) if(!this.SelectStart.bOutside)
this.elements[start_X][start_Y].Selection_Remove(); this.elements[start_X][start_Y].Selection_Remove();
this.bSelectionUse = false; this.bSelectionUse = false;
......
...@@ -454,6 +454,8 @@ CRecalculateInfo.prototype = ...@@ -454,6 +454,8 @@ CRecalculateInfo.prototype =
{ {
leftCoeff = rightCoeff/2; leftCoeff = rightCoeff/2;
} }
else
leftCoeff -= rightCoeff/2;
} }
else else
{ {
...@@ -5071,10 +5073,20 @@ CMathContent.prototype = ...@@ -5071,10 +5073,20 @@ CMathContent.prototype =
} }
if(RecalcInfo.Current !== null) if(RecalcInfo.Current !== null)
RecalcInfo.Current.GapRight = 0; RecalcInfo.Current.GapRight = 0;
/*if(this.bRoot)
{
for(var pos = 0; pos < lng; pos++)
{
if(this.content[pos].typeObj == MATH_COMP)
console.log("Gap left " + this.content[pos].GapLeft + " Gap Right " + this.content[pos].GapRight);
}
console.log("");
}*/
this.recalculateSize(ParaMath, oMeasure); this.recalculateSize(ParaMath, oMeasure);
}, },
IsEmptyRun: function(pos) // пустой Para_Run IsEmptyRun: function(pos) // пустой Para_Run
...@@ -5111,8 +5123,8 @@ CMathContent.prototype = ...@@ -5111,8 +5123,8 @@ CMathContent.prototype =
if(!checkGap.bChildGaps) if(!checkGap.bChildGaps)
{ {
var gapsMComp = RecalcInfo.getGapsMComp(this.content[1]); gaps.left = RecalcInfo.getGapsMComp(this.content[1], -1);
gaps.left = gapsMComp.left; //gaps.left = gapsMComp.left;
} }
} }
...@@ -5122,8 +5134,8 @@ CMathContent.prototype = ...@@ -5122,8 +5134,8 @@ CMathContent.prototype =
if(!checkGap.bChildGaps) if(!checkGap.bChildGaps)
{ {
var gapsMComp = RecalcInfo.getGapsMComp(this.content[len - 1]); gaps.right = RecalcInfo.getGapsMComp(this.content[len - 1], 1);
gaps.right = gapsMComp.right; //gaps.right = gapsMComp.right;
} }
} }
...@@ -5681,6 +5693,10 @@ CMathContent.prototype = ...@@ -5681,6 +5693,10 @@ CMathContent.prototype =
NewPos.x = pos.x; NewPos.x = pos.x;
NewPos.y = pos.y + this.size.ascent; // y по baseline; NewPos.y = pos.y + this.size.ascent; // y по baseline;
//console.log("SetPosition");
var check = this.content.length > 1 && this.content[1].typeObj == MATH_COMP && !this.bRoot;
var check2 = this.bRoot;
for(var i=0; i < this.content.length; i++) for(var i=0; i < this.content.length; i++)
{ {
...@@ -5696,7 +5712,18 @@ CMathContent.prototype = ...@@ -5696,7 +5712,18 @@ CMathContent.prototype =
} }
else if(this.content[i].typeObj == MATH_PLACEHOLDER) else if(this.content[i].typeObj == MATH_PLACEHOLDER)
this.content[i].setPosition(NewPos); this.content[i].setPosition(NewPos);
if(check2)
{
if(this.content[i].typeObj == MATH_COMP)
console.log("X " + NewPos.x);
}
} }
if(check2)
console.log("");
}, },
///// properties ///// ///// properties /////
SetDot: function(flag) SetDot: function(flag)
......
...@@ -9,6 +9,8 @@ function CGlyphOperator() ...@@ -9,6 +9,8 @@ function CGlyphOperator()
this.stretch = 0; this.stretch = 0;
this.bStretch = true; this.bStretch = true;
this.MIN_AUG = 1;
this.penW = 1; // px this.penW = 1; // px
} }
CGlyphOperator.prototype.init = function(props) CGlyphOperator.prototype.init = function(props)
...@@ -30,6 +32,11 @@ CGlyphOperator.prototype.init = function(props) ...@@ -30,6 +32,11 @@ CGlyphOperator.prototype.init = function(props)
this.loc = props.location; this.loc = props.location;
this.turn = props.turn; this.turn = props.turn;
this.bStretch = (props.bStretch == true || props.bStretch == false) ? props.bStretch : true; this.bStretch = (props.bStretch == true || props.bStretch == false) ? props.bStretch : true;
if(this.loc == LOCATION_TOP || this.loc == LOCATION_BOT)
this.MIN_AUG = 0.8;
else
this.MIN_AUG = 1;
} }
CGlyphOperator.prototype.fixSize = function(stretch) CGlyphOperator.prototype.fixSize = function(stretch)
{ {
...@@ -37,7 +44,7 @@ CGlyphOperator.prototype.fixSize = function(stretch) ...@@ -37,7 +44,7 @@ CGlyphOperator.prototype.fixSize = function(stretch)
var width, height, ascent; var width, height, ascent;
//var betta = this.getTxtPrp().FontSize/36; //var betta = this.getTxtPrp().FontSize/36;
var bHor = this.loc == 0 || this.loc == 1; var bHor = this.loc == LOCATION_TOP || this.loc == LOCATION_BOT;
if(bHor) if(bHor)
{ {
......
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