File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 100
100
cos = Math . cos ( this . angle ) ,
101
101
sin = Math . sin ( this . angle ) ,
102
102
nodeRatio = Math . pow ( this . ratio , this . settings ( 'nodesPowRatio' ) ) ,
103
- edgeRatio = Math . pow ( this . ratio , this . settings ( 'edgesPowRatio' ) ) ;
103
+ edgeRatio = Math . pow ( this . ratio , this . settings ( 'edgesPowRatio' ) ) ,
104
+ xDivider = this . ratio + ( options . width || 0 ) / 2 ,
105
+ yDivider = this . ratio + ( options . height || 0 ) / 2 ;
104
106
105
107
for ( i = 0 , l = nodes . length ; i < l ; i ++ ) {
106
108
node = nodes [ i ] ;
107
109
node [ write + 'x' ] =
108
110
(
109
111
( ( node [ read + 'x' ] || 0 ) - this . x ) * cos +
110
112
( ( node [ read + 'y' ] || 0 ) - this . y ) * sin
111
- ) / this . ratio + ( options . width || 0 ) / 2 ;
113
+ ) / xDivider ;
112
114
node [ write + 'y' ] =
113
115
(
114
116
( ( node [ read + 'y' ] || 0 ) - this . y ) * cos -
115
117
( ( node [ read + 'x' ] || 0 ) - this . x ) * sin
116
- ) / this . ratio + ( options . height || 0 ) / 2 ;
118
+ ) / yDivider ;
117
119
node [ write + 'size' ] =
118
120
( node [ read + 'size' ] || 0 ) /
119
121
nodeRatio ;
You can’t perform that action at this time.
0 commit comments