mirror of
https://github.com/scratchfoundation/scratch-render.git
synced 2025-07-27 06:30:02 -04:00
Merge branch 'develop' into removeRenderQuirks
This commit is contained in:
commit
71ecef29a2
2 changed files with 3 additions and 1 deletions
|
@ -43,7 +43,7 @@
|
||||||
"linebreak": "0.3.0",
|
"linebreak": "0.3.0",
|
||||||
"raw-loader": "^0.5.1",
|
"raw-loader": "^0.5.1",
|
||||||
"scratch-storage": "^0.4.0",
|
"scratch-storage": "^0.4.0",
|
||||||
"scratch-svg-renderer": "0.1.0-prerelease.20180511144653",
|
"scratch-svg-renderer": "0.1.0-prerelease.20180514170126",
|
||||||
"scratch-vm": "0.1.0-prerelease.1525975472",
|
"scratch-vm": "0.1.0-prerelease.1525975472",
|
||||||
"tap": "^11.0.0",
|
"tap": "^11.0.0",
|
||||||
"travis-after-all": "^1.4.4",
|
"travis-after-all": "^1.4.4",
|
||||||
|
|
|
@ -79,6 +79,7 @@ class Silhouette {
|
||||||
* @return {boolean} If the nearest pixel has an alpha value.
|
* @return {boolean} If the nearest pixel has an alpha value.
|
||||||
*/
|
*/
|
||||||
isTouchingNearest (vec) {
|
isTouchingNearest (vec) {
|
||||||
|
if (!this._data) return;
|
||||||
return getPoint(
|
return getPoint(
|
||||||
this,
|
this,
|
||||||
Math.round(vec[0] * (this._width - 1)),
|
Math.round(vec[0] * (this._width - 1)),
|
||||||
|
@ -93,6 +94,7 @@ class Silhouette {
|
||||||
* @return {boolean} Any of the pixels have some alpha.
|
* @return {boolean} Any of the pixels have some alpha.
|
||||||
*/
|
*/
|
||||||
isTouchingLinear (vec) {
|
isTouchingLinear (vec) {
|
||||||
|
if (!this._data) return;
|
||||||
const x = Math.floor(vec[0] * (this._width - 1));
|
const x = Math.floor(vec[0] * (this._width - 1));
|
||||||
const y = Math.floor(vec[1] * (this._height - 1));
|
const y = Math.floor(vec[1] * (this._height - 1));
|
||||||
return getPoint(this, x, y) > 0 ||
|
return getPoint(this, x, y) > 0 ||
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue