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

1. Поправила расчет Bounds для мат объектов

2. Расположение степени (однострочной), min (Inside)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62172 954022d7-b5bf-4e40-9824-e11837661b57
parent 515ffdea
...@@ -1875,15 +1875,6 @@ CMathBase.prototype.Update_WordLen = function(PRS, WordLen) ...@@ -1875,15 +1875,6 @@ CMathBase.prototype.Update_WordLen = function(PRS, WordLen)
{ {
PRS.WordLen = WordLen + this.size.width; PRS.WordLen = WordLen + this.size.width;
/*
if(true !== PRS.Word)
{
PRS.WordLen = this.size.width;
}
else
{
PRS.WordLen = WordLen + this.size.width;
}*/
} }
}; };
CMathBase.prototype.Recalculate_Range_OneLine = function(PRS, ParaPr, Depth) CMathBase.prototype.Recalculate_Range_OneLine = function(PRS, ParaPr, Depth)
...@@ -1904,16 +1895,26 @@ CMathBase.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _C ...@@ -1904,16 +1895,26 @@ CMathBase.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, _C
if(this.bOneLine) if(this.bOneLine)
{ {
var ParentContentMetric = PRS.ContentMetrics;
for (var CurPos = 0; CurPos <= this.Content.length - 1; CurPos++) for (var CurPos = 0; CurPos <= this.Content.length - 1; CurPos++)
{ {
PRS.ContentMetrics = new CMathBoundsMeasures();
var Item = this.Content[CurPos]; var Item = this.Content[CurPos];
Item.Recalculate_LineMetrics(PRS, ParaPr, _CurLine, _CurRange); Item.Recalculate_LineMetrics(PRS, ParaPr, _CurLine, _CurRange);
} }
this.Bounds.UpdateMetrics(CurLine, this.size); this.Bounds.UpdateMetrics(CurLine, this.size);
PRS.ContentMetrics.UpdateMetrics(this.size);
this.UpdatePRS(PRS, this.size); ParentContentMetric.UpdateMetrics(this.size);
PRS.ContentMetrics.SetBound(ParentContentMetric);
//PRS.ContentMetrics.UpdateMetrics(this.size);
if(this.Parent.bRoot)
{
this.UpdatePRS(PRS, this.size);
}
} }
else else
{ {
...@@ -2182,6 +2183,15 @@ function CMathBoundsMeasures() ...@@ -2182,6 +2183,15 @@ function CMathBoundsMeasures()
this.Asc = 0; this.Asc = 0;
this.Page = 0; this.Page = 0;
} }
CMathBoundsMeasures.prototype.SetBound = function(Bound)
{
this.X = Bound.X;
this.Y = Bound.Y;
this.W = Bound.W;
this.H = Bound.H;
this.Asc = Bound.Asc;
this.Page = Bound.Page;
};
CMathBoundsMeasures.prototype.UpdateMetrics = function(Metric) CMathBoundsMeasures.prototype.UpdateMetrics = function(Metric)
{ {
var MetricH = Metric.Type == MATH_SIZE ? Metric.height : Metric.H; var MetricH = Metric.Type == MATH_SIZE ? Metric.height : Metric.H;
......
...@@ -316,10 +316,10 @@ CDegreeBase.prototype.setPosition = function(pos, PRSA, Line, Range, Page) ...@@ -316,10 +316,10 @@ CDegreeBase.prototype.setPosition = function(pos, PRSA, Line, Range, Page)
PosBase.y = this.pos.y; PosBase.y = this.pos.y;
PosBase.x = this.pos.x; PosBase.x = this.pos.x;
if(this.baseContent.Type == para_Math_Content) PosBase.y += this.size.ascent - this.baseContent.size.ascent;
if(!this.baseContent.IsJustDraw())
PosBase.y += this.baseContent.size.ascent; PosBase.y += this.baseContent.size.ascent;
else
PosBase.y += this.size.ascent - this.baseContent.size.ascent;
this.baseContent.setPosition(PosBase, PRSA, Line, Range, Page); this.baseContent.setPosition(PosBase, PRSA, Line, Range, Page);
......
...@@ -4158,7 +4158,8 @@ CMathContent.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine, ...@@ -4158,7 +4158,8 @@ CMathContent.prototype.Recalculate_LineMetrics = function(PRS, ParaPr, _CurLine,
this.Bounds.UpdateMetrics(CurLine, PRS.ContentMetrics); this.Bounds.UpdateMetrics(CurLine, PRS.ContentMetrics);
ParentContentMetric.UpdateMetrics(PRS.ContentMetrics); ParentContentMetric.UpdateMetrics(PRS.ContentMetrics);
PRS.ContentMetrics = ParentContentMetric; //PRS.ContentMetrics = ParentContentMetric;
PRS.ContentMetrics.SetBound(ParentContentMetric);
}; };
CMathContent.prototype.Get_Bounds = function() CMathContent.prototype.Get_Bounds = function()
{ {
......
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