@@ -1982,7 +1982,8 @@ module.exports = function (opts, cy, $, debounce) {
19821982 var minNode = nodes [ 0 ] , min = lines . getDims ( minNode ) [ type ] [ "center" ] ;
19831983 var maxNode = nodes [ 0 ] , max = lines . getDims ( maxNode ) [ type ] [ "center" ] ;
19841984
1985- for ( node of nodes ) {
1985+ for ( var i = 0 ; i < nodes . length ; i ++ ) {
1986+ var node = nodes [ i ] ;
19861987 if ( lines . getDims ( node ) [ type ] [ "center" ] < min ) {
19871988 min = lines . getDims ( node ) [ type ] [ "center" ] ; minNode = node ;
19881989 }
@@ -2010,14 +2011,16 @@ module.exports = function (opts, cy, $, debounce) {
20102011 // Find nodes in range and check if they align
20112012 HTree . forEach ( function ( key , nodes ) {
20122013
2013- for ( left of nodes ) {
2014+ for ( var i = 0 ; i < nodes . length ; i ++ ) {
2015+ var left = nodes [ i ] ;
20142016 var leftDim = lines . getDims ( left ) ;
20152017 if ( Math . abs ( leftDim [ "vertical" ] [ "center" ] - nodeDim [ "vertical" ] [ "center" ] ) < options . guidelinesStyle . range * cy . zoom ( ) ) {
20162018 if ( ( leftDim [ "horizontal" ] [ "right" ] ) == key &&
20172019 nodeDim [ "horizontal" ] [ "left" ] - leftDim [ "horizontal" ] [ "right" ] > options . guidelinesStyle . minDistRange ) {
20182020 var ripo = Math . round ( 2 * Xcenter ) - key ;
20192021 HTree . forEach ( function ( $ , rightNodes ) {
2020- for ( right of rightNodes ) {
2022+ for ( var j = 0 ; j < rightNodes . length ; j ++ ) {
2023+ var right = rightNodes [ j ] ;
20212024 if ( Math . abs ( lines . getDims ( right ) [ "vertical" ] [ "center" ] - Ycenter ) < options . guidelinesStyle . range * cy . zoom ( ) ) {
20222025 if ( Math . abs ( ripo - lines . getDims ( right ) [ "horizontal" ] [ "left" ] ) < 2 * options . guidelinesTolerance ) {
20232026 leftNode = left ; rightNode = right ;
@@ -2123,15 +2126,17 @@ module.exports = function (opts, cy, $, debounce) {
21232126 // Find nodes in range and check if they align
21242127 VTree . forEach ( function ( key , nodes ) {
21252128
2126- for ( below of nodes ) {
2129+ for ( var i = 0 ; i < nodes . length ; i ++ ) {
2130+ var below = nodes [ i ] ;
21272131 var belowDim = lines . getDims ( below ) ;
21282132 if ( Math . abs ( belowDim [ "horizontal" ] [ "center" ] - nodeDim [ "horizontal" ] [ "center" ] ) < options . guidelinesStyle . range * cy . zoom ( ) ) {
21292133 if ( belowDim [ "vertical" ] [ "bottom" ] == key &&
21302134 nodeDim [ "vertical" ] [ "top" ] - belowDim [ "vertical" ] [ "bottom" ] > options . guidelinesStyle . minDistRange ) {
21312135 var abpo = Math . round ( ( 2 * Ycenter ) - key ) ;
21322136 VTree . forEach ( function ( $ , aboveNodes ) {
21332137 //if (aboveNodes){
2134- for ( above of aboveNodes ) {
2138+ for ( var j = 0 ; j < aboveNodes . length ; j ++ ) {
2139+ var above = aboveNodes [ j ] ;
21352140 if ( Math . abs ( lines . getDims ( above ) [ "horizontal" ] [ "center" ] - Xcenter ) < options . guidelinesStyle . range * cy . zoom ( ) ) {
21362141 if ( Math . abs ( abpo - lines . getDims ( above ) [ "vertical" ] [ "top" ] ) < 2 * options . guidelinesTolerance ) {
21372142 belowNode = below ; aboveNode = above ;
@@ -2256,7 +2261,8 @@ module.exports = function (opts, cy, $, debounce) {
22562261
22572262 // find the closest alignment in range of tolerance
22582263 Tree . forEach ( function ( exKey , nodes ) {
2259- for ( n of nodes ) {
2264+ for ( var i = 0 ; i < nodes . length ; i ++ ) {
2265+ var n = nodes [ i ] ;
22602266 if ( options . centerToEdgeAlignment || ( dimKey != "center" && n . renderedPosition ( otherAxis ) != exKey ) || ( dimKey == "center" && n . renderedPosition ( otherAxis ) == exKey ) ) {
22612267 var dif = Math . abs ( center - n . renderedPosition ( axis ) ) ;
22622268 if ( dif < targetKey && dif < options . guidelinesStyle . geometricGuidelineRange * cy . zoom ( ) ) {
@@ -2318,14 +2324,16 @@ module.exports = function (opts, cy, $, debounce) {
23182324
23192325 // Find nodes in range and check if they align
23202326 HTree . forEach ( function ( key , nodes ) {
2321- for ( left of nodes ) {
2327+ for ( var i = 0 ; i < nodes . length ; i ++ ) {
2328+ var left = nodes [ i ] ;
23222329 var leftDim = lines . getDims ( left ) ;
23232330 if ( Math . abs ( leftDim [ "vertical" ] [ "center" ] - nodeDim [ "vertical" ] [ "center" ] ) < options . guidelinesStyle . range * cy . zoom ( ) ) {
23242331 if ( ( leftDim [ "horizontal" ] [ otherSide ] ) == key &&
23252332 compare [ type ] ( leftDim [ "horizontal" ] [ otherSide ] , nodeDim [ "horizontal" ] [ side ] ) ) {
23262333 var ll = leftDim [ "horizontal" ] [ side ] - ( nodeDim [ "horizontal" ] [ side ] - key ) ;
23272334 HTree . forEach ( function ( $ , rightNodes ) {
2328- for ( right of rightNodes ) {
2335+ for ( var j = 0 ; j < rightNodes . length ; j ++ ) {
2336+ var right = rightNodes [ j ] ;
23292337 if ( Math . abs ( lines . getDims ( right ) [ "vertical" ] [ "center" ] - Ycenter ) < options . guidelinesStyle . range * cy . zoom ( ) ) {
23302338 if ( Math . abs ( ll - lines . getDims ( right ) [ "horizontal" ] [ otherSide ] ) < 2 * options . guidelinesTolerance ) {
23312339 leftNode = left ; rightNode = right ;
@@ -2448,15 +2456,16 @@ module.exports = function (opts, cy, $, debounce) {
24482456 }
24492457 // Find nodes in range and check if they align
24502458 VTree . forEach ( function ( key , nodes ) {
2451-
2452- for ( below of nodes ) {
2459+ for ( var i = 0 ; i < nodes . length ; i ++ ) {
2460+ var below = nodes [ i ] ;
24532461 var belowDim = lines . getDims ( below ) ;
24542462 if ( Math . abs ( belowDim [ "horizontal" ] [ "center" ] - nodeDim [ "horizontal" ] [ "center" ] ) < options . guidelinesStyle . range * cy . zoom ( ) ) {
24552463 if ( belowDim [ "vertical" ] [ otherSide ] == key &&
24562464 compare [ type ] ( belowDim [ "vertical" ] [ otherSide ] , nodeDim [ "vertical" ] [ side ] ) ) {
24572465 var ll = belowDim [ "vertical" ] [ side ] - ( nodeDim [ "vertical" ] [ side ] - key ) ;
24582466 VTree . forEach ( function ( $ , aboveNodes ) {
2459- for ( above of aboveNodes ) {
2467+ for ( var j = 0 ; j < aboveNodes . length ; j ++ ) {
2468+ var above = aboveNodes [ j ] ;
24602469 if ( Math . abs ( lines . getDims ( above ) [ "horizontal" ] [ "center" ] - Xcenter ) < options . guidelinesStyle . range * cy . zoom ( ) ) {
24612470 if ( Math . abs ( ll - lines . getDims ( above ) [ "vertical" ] [ otherSide ] ) < 2 * options . guidelinesTolerance ) {
24622471 belowNode = below ; aboveNode = above ;
0 commit comments