Skip to content

Commit f9c44bf

Browse files
committed
Update overlooked test after changing xshift/yshift to x0shift,x1shift/y0shift,y1shift
1 parent 82de6b1 commit f9c44bf

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

test/jasmine/tests/shapes_test.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,8 +1520,8 @@ describe('Test shapes', function() {
15201520
function testPathDrag(dx, dy, layoutShape, node) {
15211521
var xa = Axes.getFromId(gd, layoutShape.xref);
15221522
var ya = Axes.getFromId(gd, layoutShape.yref);
1523-
var x2p = helpers.getDataToPixel(gd, xa, layoutShape.xshift);
1524-
var y2p = helpers.getDataToPixel(gd, ya, layoutShape.yshift, true);
1523+
var x2p = helpers.getDataToPixel(gd, xa);
1524+
var y2p = helpers.getDataToPixel(gd, ya, undefined, true);
15251525

15261526
var initialPath = layoutShape.path;
15271527
var initialCoordinates = getPathCoordinates(initialPath, x2p, y2p);
@@ -1552,8 +1552,14 @@ describe('Test shapes', function() {
15521552
function testShapeResize(direction, dx, dy, layoutShape, node) {
15531553
var xa = Axes.getFromId(gd, layoutShape.xref);
15541554
var ya = Axes.getFromId(gd, layoutShape.yref);
1555-
var x2p = helpers.getDataToPixel(gd, xa, layoutShape.xshift);
1556-
var y2p = helpers.getDataToPixel(gd, ya, layoutShape.yshift, true);
1555+
var x2p = function(v, shift) {
1556+
var dataToPixel = helpers.getDataToPixel(gd, xa, shift, false);
1557+
return dataToPixel(v);
1558+
};
1559+
var y2p = function(v, shift) {
1560+
var dataToPixel = helpers.getDataToPixel(gd, ya, shift, true);
1561+
return dataToPixel(v);
1562+
};
15571563

15581564
var initialCoordinates = getShapeCoordinates(layoutShape, x2p, y2p);
15591565

@@ -1596,8 +1602,14 @@ describe('Test shapes', function() {
15961602

15971603
var xa = Axes.getFromId(gd, layoutShape.xref);
15981604
var ya = Axes.getFromId(gd, layoutShape.yref);
1599-
var x2p = helpers.getDataToPixel(gd, xa, layoutShape.xshift);
1600-
var y2p = helpers.getDataToPixel(gd, ya, layoutShape.yshift, true);
1605+
var x2p = function(v, shift) {
1606+
var dataToPixel = helpers.getDataToPixel(gd, xa, shift);
1607+
return dataToPixel(v);
1608+
};
1609+
var y2p = function(v, shift) {
1610+
var dataToPixel = helpers.getDataToPixel(gd, ya, shift, true);
1611+
return dataToPixel(v);
1612+
};
16011613

16021614
promise = promise.then(function() {
16031615
var dragHandle = pointToMove === 'start' ?

0 commit comments

Comments
 (0)