Commit ae788e5f authored by GoshaZotov's avatar GoshaZotov

fix bug with stacked charts(rotate OX)

parent dde4a291
......@@ -163,7 +163,7 @@ Processor3D.prototype._recalculateScaleWithMaxWidth = function()
{
this.widthCanvas = optimalWidth + (this.left + this.right);
this._calculateScaleNStandard();
optimalWidthLine = this.depthPerspective * Math.sin(-this.angleOy) + ((this.widthCanvas - (this.left + this.right)) / this.aspectRatioX) / this.scaleX;
optimalWidthLine = Math.abs(this.depthPerspective * Math.sin(-this.angleOy)) + ((this.widthCanvas - (this.left + this.right)) / this.aspectRatioX) / this.scaleX;
kF = optimalWidthLine / widthLine;
if(optimalWidthLine < widthLine)
......@@ -173,7 +173,7 @@ Processor3D.prototype._recalculateScaleWithMaxWidth = function()
}
else
{
this.aspectRatioX = widthLine / ((optimalWidthLine - this.depthPerspective*Math.sin(-this.angleOy))/kF);
this.aspectRatioX = widthLine / ((optimalWidthLine - Math.abs(this.depthPerspective * Math.sin(-this.angleOy))) / kF);
this.scaleY = this.scaleY * kF;
this.scaleZ = this.scaleZ * kF;
......@@ -181,9 +181,9 @@ Processor3D.prototype._recalculateScaleWithMaxWidth = function()
}
this._recalculateCameraDiff();
return;
}
else
{
//TODO протестировать, и если не будет проблем, то убрать if-else
if(this.angleOy != 0)
{
......@@ -246,6 +246,7 @@ Processor3D.prototype._recalculateScaleWithMaxWidth = function()
this._recalculateCameraDiff();
}
}
};
Processor3D.prototype._calculateScaleNStandard = 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