8000 Account for shift when dragging a shape · plotly/plotly.js@5509ee6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5509ee6

Browse files
committed
Account for shift when dragging a shape
1 parent 18e7c84 commit 5509ee6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/shapes/draw_newshape/newshapes.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ function newShapes(outlines, dragOptions) {
8484
case 'line':
8585
case 'rect':
8686
case 'circle':
87-
modifyItem('x0', afterEdit.x0);
88-
modifyItem('x1', afterEdit.x1);
89-
modifyItem('y0', afterEdit.y0);
90-
modifyItem('y1', afterEdit.y1);
87+
modifyItem('x0', afterEdit.x0 - (beforeEdit.x0shift || 0));
88+
modifyItem('x1', afterEdit.x1 - (beforeEdit.x1shift || 0));
89+
modifyItem('y0', afterEdit.y0 - (beforeEdit.y0shift || 0));
90+
modifyItem('y1', afterEdit.y1 - (beforeEdit.y1shift || 0));
9191
break;
9292

9393
case 'path':

0 commit comments

Comments
 (0)
0