Skip to content

Commit 01903bd

Browse files
committed
test: Update shape drag test
* Initiate drag move at the shape centre to avoid resizing the shape.
1 parent abd8e93 commit 01903bd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/jasmine/tests/shapes_test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,6 @@ function decodeDate(convertToPx) {
595595

596596

597597
var DBLCLICKDELAY = require('@src/plots/cartesian/constants').DBLCLICKDELAY;
598-
var getBBox = require('../assets/get_bbox');
599598

600599
function mouseDown(node, x, y) {
601600
node.dispatchEvent(new MouseEvent('mousedown', {
@@ -622,9 +621,9 @@ function mouseUp(node, x, y) {
622621
}
623622

624623
function drag(node, dx, dy) {
625-
var bbox = getBBox(node),
626-
fromX = bbox.x,
627-
fromY = bbox.y,
624+
var bbox = node.getBoundingClientRect(),
625+
fromX = (bbox.left + bbox.right) / 2,
626+
fromY = (bbox.bottom + bbox.top) / 2,
628627
toX = fromX + dx,
629628
toY = fromY + dy;
630629

0 commit comments

Comments
 (0)