@@ -345,8 +345,8 @@ annotations.draw = function(gd, index, opt, value) {
345
345
. classed ( 'annotation-text-g' , true )
346
346
. attr ( 'data-index' , String ( index ) ) ;
347
347
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)' ) ;
350
350
351
351
var borderwidth = options . borderwidth ,
352
352
borderpad = options . borderpad ,
@@ -491,10 +491,10 @@ annotations.draw = function(gd, index, opt, value) {
491
491
492
492
annbg . call ( Plotly . Drawing . setRect , borderwidth / 2 , borderwidth / 2 ,
493
493
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 + ')' ) ;
498
498
499
499
var annbase = 'annotations[' + index + ']' ;
500
500
0 commit comments