Commit 60ec04bc authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

не подбираем размер автофигуры в определенных случаях.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62839 954022d7-b5bf-4e40-9824-e11837661b57
parent e804d14a
...@@ -3669,6 +3669,7 @@ DrawingObjectsController.prototype = ...@@ -3669,6 +3669,7 @@ DrawingObjectsController.prototype =
{ {
content.Remove(dir, true, bRemoveOnlySelection) content.Remove(dir, true, bRemoveOnlySelection)
} }
target_text_object.checkExtentsByDocContent();
} }
} }
else if(this.selectedObjects.length > 0) else if(this.selectedObjects.length > 0)
......
...@@ -25,6 +25,7 @@ var APPROXIMATE_EPSILON3 = 5; ...@@ -25,6 +25,7 @@ var APPROXIMATE_EPSILON3 = 5;
var cToRad = Math.PI/(60000*180); var cToRad = Math.PI/(60000*180);
var cToDeg = 1/cToRad; var cToDeg = 1/cToRad;
var MAX_ITER_COUNT = 50;
var oGdLst = {}; var oGdLst = {};
oGdLst["_3cd4"]= 16200000; oGdLst["_3cd4"]= 16200000;
...@@ -1330,7 +1331,7 @@ Geometry.prototype= ...@@ -1330,7 +1331,7 @@ Geometry.prototype=
var dDelta = 0; var dDelta = 0;
var dWi = dTextWidth, dHi = dTextHeight, dWNext, dHNext; var dWi = dTextWidth, dHi = dTextHeight, dWNext, dHNext;
var oGeometry = ExecuteNoHistory(function(){return this.createDuplicate()}, this, []); var oGeometry = ExecuteNoHistory(function(){return this.createDuplicate()}, this, []);
var iter_Count = 0;
if(!isRealNumber(dGeometryWidth) && !isRealNumber(dGeometryHeight)) if(!isRealNumber(dGeometryWidth) && !isRealNumber(dGeometryHeight))
{ {
do do
...@@ -1341,9 +1342,10 @@ Geometry.prototype= ...@@ -1341,9 +1342,10 @@ Geometry.prototype=
dDelta = Math.max(Math.abs(dWNext - dWi), Math.abs(dHNext - dHi)); dDelta = Math.max(Math.abs(dWNext - dWi), Math.abs(dHNext - dHi));
dWi = dWNext; dWi = dWNext;
dHi = dHNext; dHi = dHNext;
++iter_Count;
} }
while(dDelta > EPSILON_TEXT_AUTOFIT); while(dDelta > EPSILON_TEXT_AUTOFIT && iter_Count < MAX_ITER_COUNT);
return {W: dWi, H: dHi}; return {W: dWi, H: dHi, bError: dDelta > EPSILON_TEXT_AUTOFIT};
} }
else if(isRealNumber(dGeometryWidth)) else if(isRealNumber(dGeometryWidth))
{ {
...@@ -1353,9 +1355,10 @@ Geometry.prototype= ...@@ -1353,9 +1355,10 @@ Geometry.prototype=
dHNext = dTextHeight - (oGeometry.rect.b - oGeometry.rect.t) + dHi; dHNext = dTextHeight - (oGeometry.rect.b - oGeometry.rect.t) + dHi;
dDelta = Math.abs(dHNext - dHi); dDelta = Math.abs(dHNext - dHi);
dHi = dHNext; dHi = dHNext;
++iter_Count;
} }
while(dDelta > EPSILON_TEXT_AUTOFIT); while(dDelta > EPSILON_TEXT_AUTOFIT && iter_Count < MAX_ITER_COUNT);
return {W: dGeometryWidth, H: dHi}; return {W: dGeometryWidth, H: dHi, bError: dDelta > EPSILON_TEXT_AUTOFIT};
} }
else else
{ {
...@@ -1365,9 +1368,10 @@ Geometry.prototype= ...@@ -1365,9 +1368,10 @@ Geometry.prototype=
dWNext = dTextWidth - (oGeometry.rect.r - oGeometry.rect.l) + dWi; dWNext = dTextWidth - (oGeometry.rect.r - oGeometry.rect.l) + dWi;
dDelta = Math.abs(dWNext - dWi); dDelta = Math.abs(dWNext - dWi);
dWi = dWNext; dWi = dWNext;
++iter_Count;
} }
while(dDelta > EPSILON_TEXT_AUTOFIT); while(dDelta > EPSILON_TEXT_AUTOFIT && iter_Count < MAX_ITER_COUNT);
return {W: dWi, H: dGeometryHeight}; return {W: dWi, H: dGeometryHeight, bError: dDelta > EPSILON_TEXT_AUTOFIT};
} }
} }
}; };
......
This diff is collapsed.
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