@@ -834,7 +834,7 @@ describe('A fixed size path shape', function() {
834834 it ( 'is draggable' , function ( done ) {
835835 Plotly . plot ( gd , data , layout , { editable : true } )
836836 . then ( function ( ) {
837- drag ( getFirstShapeNode ( ) , 50 , 50 ) . then ( function ( ) {
837+ drag ( { node : getFirstShapeNode ( ) , dpos : [ 50 , 50 ] } ) . then ( function ( ) {
838838 assertShapeSize ( getFirstShapeNode ( ) , 30 , 20 ) ;
839839 done ( ) ;
840840 } ) ;
@@ -852,7 +852,7 @@ describe('A fixed size path shape', function() {
852852 var shapeNodeBeforeDrag = getFirstShapeNode ( ) ;
853853 var widthBeforeDrag = shapeNodeBeforeDrag . getBoundingClientRect ( ) . width ;
854854
855- drag ( shapeNodeBeforeDrag , 300 , 50 ) . then ( function ( ) {
855+ drag ( { node : shapeNodeBeforeDrag , dpos : [ 300 , 50 ] } ) . then ( function ( ) {
856856 var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
857857 var bbox = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
858858 expect ( bbox . height ) . toBe ( 20 ) ;
@@ -874,7 +874,7 @@ describe('A fixed size path shape', function() {
874874 var shapeNodeBeforeDrag = getFirstShapeNode ( ) ;
875875 var heightBeforeDrag = shapeNodeBeforeDrag . getBoundingClientRect ( ) . height ;
876876
877- drag ( shapeNodeBeforeDrag , 50 , 300 ) . then ( function ( ) {
877+ drag ( { node : shapeNodeBeforeDrag , dpos : [ 50 , 300 ] } ) . then ( function ( ) {
878878 var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
879879 var bbox = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
880880 expect ( bbox . width ) . toBe ( 30 ) ;
@@ -1006,7 +1006,7 @@ describe('A fixed size shape', function() {
10061006 it ( 'is draggable' , function ( done ) {
10071007 Plotly . plot ( gd , data , layout , { editable : true } )
10081008 . then ( function ( ) {
1009- drag ( getFirstShapeNode ( ) , 50 , 50 ) . then ( function ( ) {
1009+ drag ( { node : getFirstShapeNode ( ) , dpos : [ 50 , 50 ] } ) . then ( function ( ) {
10101010 assertShapeSize ( getFirstShapeNode ( ) , 25 , 25 ) ;
10111011 done ( ) ;
10121012 } ) ;
@@ -1025,7 +1025,7 @@ describe('A fixed size shape', function() {
10251025 var shapeNodeBeforeDrag = getFirstShapeNode ( ) ;
10261026 var widthBeforeDrag = shapeNodeBeforeDrag . getBoundingClientRect ( ) . width ;
10271027
1028- drag ( shapeNodeBeforeDrag , 300 , 50 ) . then ( function ( ) {
1028+ drag ( { node : shapeNodeBeforeDrag , dpos : [ 300 , 50 ] } ) . then ( function ( ) {
10291029 var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
10301030 var bbox = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
10311031 expect ( bbox . height ) . toBe ( 25 ) ;
@@ -1048,7 +1048,7 @@ describe('A fixed size shape', function() {
10481048 var shapeNodeBeforeDrag = getFirstShapeNode ( ) ;
10491049 var heightBeforeDrag = shapeNodeBeforeDrag . getBoundingClientRect ( ) . height ;
10501050
1051- drag ( shapeNodeBeforeDrag , 50 , 300 ) . then ( function ( ) {
1051+ drag ( { node : shapeNodeBeforeDrag , dpos : [ 50 , 300 ] } ) . then ( function ( ) {
10521052 var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
10531053 var bbox = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
10541054 expect ( bbox . width ) . toBe ( 25 ) ;
@@ -1088,7 +1088,7 @@ describe('A fixed size shape', function() {
10881088 var dx = shallShrink ? dxToShrinkWidth [ direction ] : dxToEnlargeWidth [ direction ] ;
10891089 var dy = shallShrink ? dyToShrinkHeight [ direction ] : dyToEnlargeHeight [ direction ] ;
10901090
1091- drag ( shapeNodeBeforeDrag , dx , dy , direction )
1091+ drag ( { node : shapeNodeBeforeDrag , dpos : [ dx , dy ] , edge : direction } )
10921092 . then ( function ( ) {
10931093 var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
10941094 var bBoxAfterDrag = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
@@ -1117,7 +1117,7 @@ describe('A fixed size shape', function() {
11171117 var bBoxBeforeDrag = shapeNodeBeforeDrag . getBoundingClientRect ( ) ;
11181118
11191119 var dragSensitiveElement = getMoveLineDragElement ( 0 ) ;
1120- drag ( dragSensitiveElement , 10 , - 10 )
1120+ drag ( { node : dragSensitiveElement , dpos : [ 10 , - 10 ] } )
11211121 . then ( function ( ) {
11221122 var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
11231123 var bBoxAfterDrag = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
@@ -1138,7 +1138,7 @@ describe('A fixed size shape', function() {
11381138 var bBoxBeforeDrag = shapeNodeBeforeDrag . getBoundingClientRect ( ) ;
11391139
11401140 var dragSensitiveElement = getResizeLineOverStartPointElement ( ) ;
1141- drag ( dragSensitiveElement , 50 , - 10 )
1141+ drag ( { node : dragSensitiveElement , dpos : [ 50 , - 10 ] } )
11421142 . then ( function ( ) {
11431143 var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
11441144 var bBoxAfterDrag = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
@@ -1161,7 +1161,7 @@ describe('A fixed size shape', function() {
11611161 var bBoxBeforeDrag = shapeNodeBeforeDrag . getBoundingClientRect ( ) ;
11621162
11631163 var dragSensitiveElement = getResizeLineOverEndPointElement ( ) ;
1164- drag ( dragSensitiveElement , 50 , - 10 )
1164+ drag ( { node : dragSensitiveElement , dpos : [ 50 , - 10 ] } )
11651165 . then ( function ( ) {
11661166 var shapeNodeAfterDrag = getFirstShapeNode ( ) ;
11671167 var bBoxAfterDrag = shapeNodeAfterDrag . getBoundingClientRect ( ) ;
@@ -1464,7 +1464,7 @@ describe('Test shapes', function() {
14641464
14651465 var initialCoordinates = getShapeCoordinates ( layoutShape , x2p , y2p ) ;
14661466
1467- return drag ( node , dx , dy ) . then ( function ( ) {
1467+ return drag ( { node : node , dpos : [ dx , dy ] } ) . then ( function ( ) {
14681468 var finalCoordinates = getShapeCoordinates ( layoutShape , x2p , y2p ) ;
14691469
14701470 expect ( finalCoordinates . x0 - initialCoordinates . x0 ) . toBeCloseTo ( dx ) ;
@@ -1494,7 +1494,7 @@ describe('Test shapes', function() {
14941494
14951495 expect ( initialCoordinates . length ) . toBe ( 6 ) ;
14961496
1497- return drag ( node , dx , dy ) . then ( function ( ) {
1497+ return drag ( { node : node , dpos : [ dx , dy ] } ) . then ( function ( ) {
14981498 var finalPath = layoutShape . path ;
14991499 var finalCoordinates = getPathCoordinates ( finalPath , x2p , y2p ) ;
15001500
@@ -1523,7 +1523,7 @@ describe('Test shapes', function() {
15231523
15241524 var initialCoordinates = getShapeCoordinates ( layoutShape , x2p , y2p ) ;
15251525
1526- return drag ( node , dx , dy , direction ) . then ( function ( ) {
1526+ return drag ( { node : node , dpos : [ dx , dy ] , edge : direction } ) . then ( function ( ) {
15271527 var finalCoordinates = getShapeCoordinates ( layoutShape , x2p , y2p ) ;
15281528
15291529 var keyN , keyS , keyW , keyE ;
@@ -1572,7 +1572,7 @@ describe('Test shapes', function() {
15721572 getResizeLineOverEndPointElement ( ) ;
15731573
15741574 var initialCoordinates = getShapeCoordinates ( layoutShape , x2p , y2p ) ;
1575- return drag ( dragHandle , 10 , 10 ) . then ( function ( ) {
1575+ return drag ( { node : dragHandle , dpos : [ 10 , 10 ] } ) . then ( function ( ) {
15761576 var finalCoordinates = getShapeCoordinates ( layoutShape , x2p , y2p ) ;
15771577
15781578 if ( pointToMove === 'start' ) {
0 commit comments