@@ -308,7 +308,7 @@ function _draw(gd, legendObj) {
308
308
}
309
309
310
310
if ( gd . _context . edits . legendPosition ) {
311
- var xf , yf , x0 , y0 , legendWidth , legendHeight ;
311
+ var xf , yf , x0 , y0 ;
312
312
313
313
legend . classed ( 'cursor-move' , true ) ;
314
314
@@ -319,16 +319,14 @@ function _draw(gd, legendObj) {
319
319
var transform = Drawing . getTranslate ( legend ) ;
320
320
x0 = transform . x ;
321
321
y0 = transform . y ;
322
- legendWidth = legendObj . _width ;
323
- legendHeight = legendObj . _height ;
324
322
} ,
325
323
moveFn : function ( dx , dy ) {
326
324
var newX = x0 + dx ;
327
325
var newY = y0 + dy ;
328
326
329
327
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 ) ;
332
330
} ,
333
331
doneFn : function ( ) {
334
332
if ( xf !== undefined && yf !== undefined ) {
0 commit comments