Commit df800f21 authored by GoshaZotov's avatar GoshaZotov

fix bug 33434

parent d14653cf
......@@ -193,18 +193,41 @@ Processor3D.prototype._recalculateScaleWithMaxWidth = function()
}
else
{
var scaleX = this.scaleX;
var scaleY = this.scaleY;
var scaleZ = this.scaleZ;
var aspectRatioX = this.aspectRatioX;
var aspectRatioY = this.aspectRatioY;
var aspectRatioZ = this.aspectRatioZ;
//если будут проблемы с поворотом standard диграмм, раскомментровать!
//TODO протестировать, и если не будет проблем, то убрать if-else
/*if(Math.abs(this.angleOy) > Math.PI)
if(Math.abs(this.angleOy) > Math.PI)
{
//рассчитываем параметры диаграммы при оптимальной ширине
this.widthCanvas = optimalWidth + (this.left + this.right);
this.calaculate3DProperties(null, null, true);
var newDepth = Math.abs(this.depthPerspective * Math.sin(-this.angleOy));
optimalWidthLine = newDepth + ((this.widthCanvas - (this.left + this.right)) / this.aspectRatioX) / this.scaleX;
kF = optimalWidthLine / widthLine;
if(optimalWidthLine < widthLine)
{
this.widthCanvas = widthCanvas;
this.scaleX = scaleX;
this.scaleY = scaleY;
this.scaleZ = scaleZ;
this.aspectRatioX = aspectRatioX;
this.aspectRatioY = aspectRatioY;
this.aspectRatioZ = aspectRatioZ;
return;
}
this.aspectRatioX = widthLine / ((optimalWidthLine - newDepth) / kF);
this.scaleY = this.scaleY * kF;
this.scaleZ = this.scaleZ * kF;
......@@ -214,20 +237,12 @@ Processor3D.prototype._recalculateScaleWithMaxWidth = function()
this._recalculateCameraDiff();
}
else
{*/
{
//рассчитываем параметры диаграммы при оптимальной ширине
this.widthCanvas = optimalWidth + (this.left + this.right);
var scaleX = this.scaleX;
var scaleY = this.scaleY;
var scaleZ = this.scaleZ;
var aspectRatioX = this.aspectRatioX;
var aspectRatioY = this.aspectRatioY;
var aspectRatioZ = this.aspectRatioZ;
this.calaculate3DProperties(null, null, true);
optimalWidthLine = this.depthPerspective * Math.sin(-this.angleOy) + ((this.widthCanvas - (this.left + this.right)) / this.aspectRatioX) / this.scaleX;
optimalWidthLine = this.depthPerspective * Math.sin(-this.angleOy) + ((this.widthCanvas - (this.left + this.right)) / this.aspectRatioX) / this.scaleX;
if(optimalWidthLine < widthLine)
{
......@@ -243,7 +258,6 @@ Processor3D.prototype._recalculateScaleWithMaxWidth = function()
return;
}
kF = optimalWidthLine / widthLine;
this.aspectRatioX = widthLine / ((optimalWidthLine - this.depthPerspective*Math.sin(-this.angleOy))/kF);
this.scaleY = this.scaleY * kF;
......@@ -252,7 +266,7 @@ Processor3D.prototype._recalculateScaleWithMaxWidth = function()
this.widthCanvas = widthCanvas;
this._recalculateCameraDiff();
//}
}
}
};
......
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