@@ -345,8 +345,8 @@ annotations.draw = function(gd, index, opt, value) {
345345 . classed ( 'annotation-text-g' , true )
346346 . attr ( 'data-index' , String ( index ) ) ;
347347
348- var ann = anng . append ( 'svg ' )
349- . call ( Plotly . Drawing . setPosition , 0 , 0 ) ;
348+ var ann = anng . append ( 'g ' )
349+ . attr ( 'transform' , 'translate(0,0)' ) ;
350350
351351 var borderwidth = options . borderwidth ,
352352 borderpad = options . borderpad ,
@@ -491,10 +491,10 @@ annotations.draw = function(gd, index, opt, value) {
491491
492492 annbg . call ( Plotly . Drawing . setRect , borderwidth / 2 , borderwidth / 2 ,
493493 outerwidth - borderwidth , outerheight - borderwidth ) ;
494- ann . call ( Plotly . Drawing . setRect ,
495- Math . round ( annPosPx . x - outerwidth / 2 ) ,
496- Math . round ( annPosPx . y - outerheight / 2 ) ,
497- outerwidth , outerheight ) ;
494+
495+ var annX = Math . round ( annPosPx . x - outerwidth / 2 ) ,
496+ annY = Math . round ( annPosPx . y - outerheight / 2 ) ;
497+ ann . attr ( 'transform' , 'translate(' + annX + ', ' + annY + ')' ) ;
498498
499499 var annbase = 'annotations[' + index + ']' ;
500500
0 commit comments