Skip to content

Commit ae46cea

Browse files
committed
Disable resize cursors for path shapes
- Reason: resize cursors were shown although resizing path shapes is not yet supported.
1 parent 014fa99 commit ae46cea

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/components/shapes/draw.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ function setupDragElement(gd, shapePath, shapeOptions, index, shapeLayer) {
132132

133133
var xPixelSized = shapeOptions.xsizemode === 'pixel',
134134
yPixelSized = shapeOptions.ysizemode === 'pixel',
135-
isLine = shapeOptions.type === 'line';
135+
isLine = shapeOptions.type === 'line',
136+
isPath = shapeOptions.type === 'path';
136137

137138
var update;
138139
var x0, y0, x1, y1, xAnchor, yAnchor, astrX0, astrY0, astrX1, astrY1, astrXAnchor, astrYAnchor;
@@ -232,7 +233,7 @@ function setupDragElement(gd, shapePath, shapeOptions, index, shapeLayer) {
232233
h = dragBBox.bottom - dragBBox.top,
233234
x = evt.clientX - dragBBox.left,
234235
y = evt.clientY - dragBBox.top,
235-
cursor = (w > MINWIDTH && h > MINHEIGHT && !evt.shiftKey) ?
236+
cursor = (!isPath && w > MINWIDTH && h > MINHEIGHT && !evt.shiftKey) ?
236237
dragElement.getCursor(x / w, 1 - y / h) :
237238
'move';
238239

@@ -358,8 +359,8 @@ function setupDragElement(gd, shapePath, shapeOptions, index, shapeLayer) {
358359
}
359360

360361
function resizeShape(dx, dy) {
361-
if(shapeOptions.type === 'path') {
362-
// TODO: implement path resize
362+
if(isPath) {
363+
// TODO: implement path resize, don't forget to update dragMode code
363364
var noOp = function(coord) { return coord; },
364365
moveX = noOp,
365366
moveY = noOp;

0 commit comments

Comments
 (0)