@@ -490,7 +490,7 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
490490
491491 // viewbox redraw at first
492492 updateSubplots ( scrollViewBox ) ;
493- ticksAndAnnotations ( ns , ew ) ;
493+ ticksAndAnnotations ( ) ;
494494
495495 // then replot after a delay to make sure
496496 // no more scrolling is coming
@@ -522,7 +522,7 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
522522 if ( xActive ) dragAxList ( xaxes , dx ) ;
523523 if ( yActive ) dragAxList ( yaxes , dy ) ;
524524 updateSubplots ( [ xActive ? - dx : 0 , yActive ? - dy : 0 , pw , ph ] ) ;
525- ticksAndAnnotations ( yActive , xActive ) ;
525+ ticksAndAnnotations ( ) ;
526526 return ;
527527 }
528528
@@ -594,12 +594,12 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
594594 }
595595
596596 updateSubplots ( [ x0 , y0 , pw - dx , ph - dy ] ) ;
597- ticksAndAnnotations ( yActive , xActive ) ;
597+ ticksAndAnnotations ( ) ;
598598 }
599599
600600 // Draw ticks and annotations (and other components) when ranges change.
601601 // Also records the ranges that have changed for use by update at the end.
602- function ticksAndAnnotations ( ns , ew ) {
602+ function ticksAndAnnotations ( ) {
603603 var activeAxIds = [ ] ;
604604 var i ;
605605
@@ -627,25 +627,7 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) {
627627 updates [ ax . _name + '.range[1]' ] = ax . range [ 1 ] ;
628628 }
629629
630- function redrawObjs ( objArray , method , shortCircuit ) {
631- for ( i = 0 ; i < objArray . length ; i ++ ) {
632- var obji = objArray [ i ] ;
633-
634- if ( ( ew && activeAxIds . indexOf ( obji . xref ) !== - 1 ) ||
635- ( ns && activeAxIds . indexOf ( obji . yref ) !== - 1 ) ) {
636- method ( gd , i ) ;
637- // once is enough for images (which doesn't use the `i` arg anyway)
638- if ( shortCircuit ) return ;
639- }
640- }
641- }
642-
643- // annotations and shapes 'draw' method is slow,
644- // use the finer-grained 'drawOne' method instead
645-
646- redrawObjs ( gd . _fullLayout . annotations || [ ] , Registry . getComponentMethod ( 'annotations' , 'drawOne' ) ) ;
647- redrawObjs ( gd . _fullLayout . shapes || [ ] , Registry . getComponentMethod ( 'shapes' , 'drawOne' ) ) ;
648- redrawObjs ( gd . _fullLayout . images || [ ] , Registry . getComponentMethod ( 'images' , 'draw' ) , true ) ;
630+ Axes . redrawComponents ( gd , activeAxIds ) ;
649631 }
650632
651633 function doubleClick ( ) {
0 commit comments