Skip to content

Commit 9289310

Browse files
committed
Revert "Improve performance of renderer.pick() calls"
This reverts commit 503dd6a. Will be fixed in another way that doesn't regress text bubbles
1 parent 503dd6a commit 9289310

1 file changed

Lines changed: 2 additions & 18 deletions

File tree

‎src/containers/stage.jsx‎

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,6 @@ class Stage extends React.Component {
184184
...this.renderer.extractColor(x, y, colorPickerRadius)
185185
};
186186
}
187-
getTargetDrawableIDs () {
188-
// Disregard pen, video sensing, and other drawables added by extensions.
189-
return this.props.vm.runtime.targets.map(i => i.drawableID);
190-
}
191187
handleDoubleClick (e) {
192188
// tw: Disable editing target changing in certain circumstances to avoid lag
193189
if (this.props.disableEditingTargetChange) {
@@ -196,13 +192,7 @@ class Stage extends React.Component {
196192
const {x, y} = getEventXY(e);
197193
// Set editing target from cursor position, if clicking on a sprite.
198194
const mousePosition = [x - this.rect.left, y - this.rect.top];
199-
const drawableId = this.renderer.pick(
200-
mousePosition[0],
201-
mousePosition[1],
202-
1,
203-
1,
204-
this.getTargetDrawableIDs()
205-
);
195+
const drawableId = this.renderer.pick(mousePosition[0], mousePosition[1]);
206196
if (drawableId === -1) return;
207197
const targetId = this.props.vm.getTargetIdForDrawableId(drawableId);
208198
if (targetId === null) return;
@@ -385,13 +375,7 @@ class Stage extends React.Component {
385375
}
386376
onStartDrag (x, y) {
387377
if (this.state.dragId) return;
388-
const drawableId = this.renderer.pick(
389-
x,
390-
y,
391-
1,
392-
1,
393-
this.getTargetDrawableIDs()
394-
);
378+
const drawableId = this.renderer.pick(x, y);
395379
if (drawableId === -1) return;
396380
const targetId = this.props.vm.getTargetIdForDrawableId(drawableId);
397381
if (targetId === null) return;

0 commit comments

Comments
 (0)