Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
df800f21
Commit
df800f21
authored
Nov 18, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 33434
parent
d14653cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
13 deletions
+27
-13
common/Charts/3DTransformation.js
common/Charts/3DTransformation.js
+27
-13
No files found.
common/Charts/3DTransformation.js
View file @
df800f21
...
...
@@ -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
();
//
}
}
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment