You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
getIntersection: function(pos){varobj,i,intersectionOffset,shape;if(this.hitGraphEnabled()&&this.isVisible()){// in some cases antialiased area may be bigger than 1px// it is possible if we will cache node, then scale it a lot// TODO: check { 0; 0 } point before loop, and remove it from INTERSECTION_OFFSETS.varspiralSearchDistance=1;varcontinueSearch=false;while(true){for(i=0;i<INTERSECTION_OFFSETS_LEN;i++){intersectionOffset=INTERSECTION_OFFSETS[i];obj=this._getIntersection({x: pos.x+intersectionOffset.x*spiralSearchDistance,y: pos.y+intersectionOffset.y*spiralSearchDistance});shape=obj.shape;if(shape){returnshape;}// we should continue search if we found antialiased pixel// that means our node somewhere very closeelseif(obj.antialiased){continueSearch=true;}}// if no shape, and no antialiased pixel, we should end searching if(continueSearch){spiralSearchDistance+=1;// now i do this avoid endless loop, it's Right?if(spiralSearchDistance>this.width()){returnnull;}}else{return;}}}else{returnnull;}}
The text was updated successfully, but these errors were encountered:
can not out the while, and now in order to avoid endless loop, i add some code like this, this right?
The text was updated successfully, but these errors were encountered: