Skip to content

Commit 48c3cf6

Browse files
authored
Merge pull request scratchfoundation#5510 from adroitwhiz/drag-refactor
Call renderer.draw immediately on drag start/stop
2 parents 4caddce + 10a27aa commit 48c3cf6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/containers/stage.jsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ class Stage extends React.Component {
362362
this.drawDragCanvas(drawableData);
363363
this.positionDragCanvas(x, y);
364364
this.props.vm.postSpriteInfo({visible: false});
365+
this.props.vm.renderer.draw();
365366
}
366367
}
367368
onStopDrag (mouseX, mouseY) {
@@ -387,12 +388,9 @@ class Stage extends React.Component {
387388
}
388389
this.props.vm.postSpriteInfo(spriteInfo);
389390
// Then clear the dragging canvas and stop drag (potentially slow if selecting sprite)
390-
setTimeout(() => {
391-
this.clearDragCanvas();
392-
setTimeout(() => {
393-
commonStopDragActions();
394-
}, 30);
395-
}, 30);
391+
this.clearDragCanvas();
392+
commonStopDragActions();
393+
this.props.vm.renderer.draw();
396394
} else {
397395
commonStopDragActions();
398396
}

0 commit comments

Comments
 (0)