Skip to content

Commit 04c5e75

Browse files
committed
use existing, calculated values of legend width and height
legendObj._height and legendObj._width are used for positioning the element at the outset, so it seems appropriate to use them again here
1 parent ab02ea4 commit 04c5e75

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/components/legend/draw.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,8 @@ function _draw(gd, legendObj) {
319319
var transform = Drawing.getTranslate(legend);
320320
x0 = transform.x;
321321
y0 = transform.y;
322-
var bbox = legend.node().getBBox();
323-
legendWidth = bbox.width;
324-
legendHeight = bbox.height;
322+
legendWidth = legendObj._width;
323+
legendHeight = legendObj._height;
325324
},
326325
moveFn: function(dx, dy) {
327326
var newX = x0 + dx;

0 commit comments

Comments
 (0)