Skip to content

Commit 257dc82

Browse files
authored
Merge pull request #303 from adzhindzhi/UEPR-312-clean-up-face-sensing-codebase
[UEPR-312] Clean up face sensing codebase
2 parents fc4c53e + f6f2232 commit 257dc82

File tree

4 files changed

+255
-265
lines changed

4 files changed

+255
-265
lines changed

packages/scratch-render/src/RenderWebGL.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,16 @@ class RenderWebGL extends EventEmitter {
10691069
return false;
10701070
}
10711071

1072+
/**
1073+
* Determine if the drawable is touching a rectangle.
1074+
*
1075+
* @param {int} drawableID The ID of the drawable to check.
1076+
* @param {int} left - The left X coordinate of the rectangle.
1077+
* @param {int} top - The top Y coordinate of the rectangle.
1078+
* @param {int} right - The right X coordinate of the rectangle.
1079+
* @param {int} bottom - The bottom Y coordinate of the rectangle.
1080+
* @returns {boolean} If the drawable has any pixels that would draw in the rectangle area
1081+
*/
10721082
drawableTouchingScratchRect (drawableID, left, top, right, bottom) {
10731083
const drawable = this._allDrawables[drawableID];
10741084
if (!drawable) {
@@ -1090,6 +1100,14 @@ class RenderWebGL extends EventEmitter {
10901100
return false;
10911101
}
10921102

1103+
/**
1104+
* Determine if the drawable is touching a point in the Scratch coordinate system
1105+
*
1106+
* @param {int} drawableID The ID of the drawable to check.
1107+
* @param {int} x The x coordinate of the point.
1108+
* @param {int} y The y coordinate of the point.
1109+
* @returns {boolean} If the drawable is touching the point
1110+
*/
10931111
drawableTouchingScratchPoint (drawableID, x, y) {
10941112
const drawable = this._allDrawables[drawableID];
10951113
if (!drawable) {

0 commit comments

Comments
 (0)