Merge branch 'develop' into removeRenderQuirks

This commit is contained in:
DD 2018-05-16 15:16:11 -04:00
commit 71ecef29a2
2 changed files with 3 additions and 1 deletions

View file

@ -43,7 +43,7 @@
"linebreak": "0.3.0",
"raw-loader": "^0.5.1",
"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",
"tap": "^11.0.0",
"travis-after-all": "^1.4.4",

View file

@ -79,6 +79,7 @@ class Silhouette {
* @return {boolean} If the nearest pixel has an alpha value.
*/
isTouchingNearest (vec) {
if (!this._data) return;
return getPoint(
this,
Math.round(vec[0] * (this._width - 1)),
@ -93,6 +94,7 @@ class Silhouette {
* @return {boolean} Any of the pixels have some alpha.
*/
isTouchingLinear (vec) {
if (!this._data) return;
const x = Math.floor(vec[0] * (this._width - 1));
const y = Math.floor(vec[1] * (this._height - 1));
return getPoint(this, x, y) > 0 ||