@@ -343,8 +343,8 @@ annotations.draw = function(gd, index, opt, value) {
343
343
. classed ( 'annotation-text-g' , true )
344
344
. attr ( 'data-index' , String ( index ) ) ;
345
345
346
- var ann = anng . append ( 'svg ' )
347
- . call ( Plotly . Drawing . setPosition , 0 , 0 ) ;
346
+ var ann = anng . append ( 'g ' )
347
+ . attr ( 'transform' , 'translate(0,0)' ) ;
348
348
349
349
var borderwidth = options . borderwidth ,
350
350
borderpad = options . borderpad ,
@@ -489,10 +489,10 @@ annotations.draw = function(gd, index, opt, value) {
489
489
490
490
annbg . call ( Plotly . Drawing . setRect , borderwidth / 2 , borderwidth / 2 ,
491
491
outerwidth - borderwidth , outerheight - borderwidth ) ;
492
- ann . call ( Plotly . Drawing . setRect ,
493
- Math . round ( annPosPx . x - outerwidth / 2 ) ,
494
- Math . round ( annPosPx . y - outerheight / 2 ) ,
495
- outerwidth , outerheight ) ;
492
+
493
+ var annX = Math . round ( annPosPx . x - outerwidth / 2 ) ,
494
+ annY = Math . round ( annPosPx . y - outerheight / 2 ) ;
495
+ ann . attr ( 'transform' , 'translate(' + annX + ', ' + annY + ')' ) ;
496
496
497
497
var annbase = 'annotations[' + index + ']' ;
498
498
0 commit comments