@@ -308,7 +308,7 @@ function _draw(gd, legendObj) {
308308 }
309309
310310 if ( gd . _context . edits . legendPosition ) {
311- var xf , yf , x0 , y0 , legendWidth , legendHeight ;
311+ var xf , yf , x0 , y0 ;
312312
313313 legend . classed ( 'cursor-move' , true ) ;
314314
@@ -319,16 +319,14 @@ function _draw(gd, legendObj) {
319319 var transform = Drawing . getTranslate ( legend ) ;
320320 x0 = transform . x ;
321321 y0 = transform . y ;
322- legendWidth = legendObj . _width ;
323- legendHeight = legendObj . _height ;
324322 } ,
325323 moveFn : function ( dx , dy ) {
326324 var newX = x0 + dx ;
327325 var newY = y0 + dy ;
328326
329327 Drawing . setTranslate ( legend , newX , newY ) ;
330- xf = dragElement . align ( newX , legendWidth , gs . l , gs . l + gs . w , legendObj . xanchor ) ;
331- yf = dragElement . align ( newY + legendHeight , - legendHeight , gs . t + gs . h , gs . t , legendObj . yanchor ) ;
328+ xf = dragElement . align ( newX , legendObj . _width , gs . l , gs . l + gs . w , legendObj . xanchor ) ;
329+ yf = dragElement . align ( newY + legendObj . _height , - legendObj . _height , gs . t + gs . h , gs . t , legendObj . yanchor ) ;
332330 } ,
333331 doneFn : function ( ) {
334332 if ( xf !== undefined && yf !== undefined ) {
0 commit comments