mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-12 21:40:59 -04:00
Use proposed drawableTouching interface from render (#1419)
* use new drawableTouching interface from render * Fix mock renderer for new API call * with lint fix
This commit is contained in:
parent
4b5cf6505a
commit
c092fe9f83
2 changed files with 5 additions and 9 deletions
|
@ -799,15 +799,7 @@ class RenderedTarget extends Target {
|
|||
*/
|
||||
isTouchingPoint (x, y) {
|
||||
if (this.renderer) {
|
||||
// @todo: Update once pick is in Scratch coordinates.
|
||||
// Limits test to this Drawable, so this will return true
|
||||
// even if the clone is obscured by another Drawable.
|
||||
const pickResult = this.runtime.renderer.pick(
|
||||
x, y,
|
||||
null, null,
|
||||
[this.drawableID]
|
||||
);
|
||||
return pickResult === this.drawableID;
|
||||
return this.renderer.drawableTouching(this.drawableID, x, y);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
4
test/fixtures/fake-renderer.js
vendored
4
test/fixtures/fake-renderer.js
vendored
|
@ -30,6 +30,10 @@ FakeRenderer.prototype.pick = function (x, y, a, b, d) { // eslint-disable-line
|
|||
return true;
|
||||
};
|
||||
|
||||
FakeRenderer.prototype.drawableTouching = function (d, x, y, w, h) { // eslint-disable-line no-unused-vars
|
||||
return true;
|
||||
};
|
||||
|
||||
FakeRenderer.prototype.isTouchingColor = function (d, c) { // eslint-disable-line no-unused-vars
|
||||
return true;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue