Skip to content

Commit 9977ec6

Browse files
authored
Merge pull request scratchfoundation#4562 from mzgoddard/mouse-move-drag-perf
Mouse move drag perf
2 parents e3dbf43 + 6f10152 commit 9977ec6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/containers/stage.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ class Stage extends React.Component {
320320
if (this.state.dragId) return;
321321
const drawableId = this.renderer.pick(x, y);
322322
if (drawableId === null) return;
323-
const drawableData = this.renderer.extractDrawable(drawableId, x, y);
324323
const targetId = this.props.vm.getTargetIdForDrawableId(drawableId);
325324
if (targetId === null) return;
326325

@@ -332,6 +331,9 @@ class Stage extends React.Component {
332331
// Dragging always brings the target to the front
333332
target.goToFront();
334333

334+
// Extract the drawable art
335+
const drawableData = this.renderer.extractDrawable(drawableId, x, y);
336+
335337
this.props.vm.startDrag(targetId);
336338
this.setState({
337339
isDragging: true,

0 commit comments

Comments
 (0)