Skip to content

Commit 3ab0052

Browse files
committed
fix movement of text during shape move
1 parent c5eb141 commit 3ab0052

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/components/shapes/display_outlines.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ module.exports = function displayOutlines(polygons, outlines, dragOptions, nCall
106106
.classed('shape-group', true)
107107
.classed('select-outline', true);
108108
}
109-
var shapeOptions = createShapeObj(outlines, dragOptions);
110-
drawLabel(gd, 100, shapeOptions, shapeGroup);
109+
var shapeOptions = createShapeObj(outlines, dragOptions, dragOptions.dragmode);
110+
drawLabel(gd, 'draw-temp', shapeOptions, shapeGroup);
111111
}
112112

113113
function startDragVertex(evt) {

src/components/shapes/draw_newshape/newshapes.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function newShapes(outlines, dragOptions) {
6262
}
6363
}
6464

65-
var newShape = createShapeObj(outlines, dragOptions);
65+
var newShape = createShapeObj(outlines, dragOptions, dragmode);
6666

6767
clearOutline(gd);
6868

@@ -105,15 +105,14 @@ function newShapes(outlines, dragOptions) {
105105
return editHelpers ? editHelpers.getUpdateObj() : {};
106106
}
107107

108-
function createShapeObj(outlines, dragOptions) {
108+
function createShapeObj(outlines, dragOptions, dragmode) {
109109
var e = outlines[0][0]; // pick first outline
110110
var gd = dragOptions.gd;
111111

112112
var d = e.getAttribute('d');
113113
var newStyle = gd._fullLayout.newshape;
114114
var plotinfo = dragOptions.plotinfo;
115115
var isActiveShape = dragOptions.isActiveShape;
116-
var dragmode = dragOptions.dragmode;
117116

118117
var xaxis = plotinfo.xaxis;
119118
var yaxis = plotinfo.yaxis;

0 commit comments

Comments
 (0)