Merge pull request #478 from adroitwhiz/fix-fence-bounds

Always use getAABB for fence bounds
This commit is contained in:
adroitwhiz
2020-05-07 15:43:28 -04:00
committed by GitHub
3 changed files with 2 additions and 12 deletions

View File

@@ -56,16 +56,6 @@ class BitmapSkin extends Skin {
return this._texture || super.getTexture();
}
/**
* Get the bounds of the drawable for determining its fenced position.
* @param {Array<number>} drawable - The Drawable instance this skin is using.
* @param {?Rectangle} result - Optional destination for bounds calculation.
* @return {!Rectangle} The drawable's bounds. For compatibility with Scratch 2, we always use getAABB for bitmaps.
*/
getFenceBounds (drawable, result) {
return drawable.getAABB(result);
}
/**
* Set the contents of this skin to a snapshot of the provided bitmap data.
* @param {ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} bitmapData - new contents for this skin.

View File

@@ -143,10 +143,10 @@ class Skin extends EventEmitter {
* Get the bounds of the drawable for determining its fenced position.
* @param {Array<number>} drawable - The Drawable instance this skin is using.
* @param {?Rectangle} result - Optional destination for bounds calculation.
* @return {!Rectangle} The drawable's bounds.
* @return {!Rectangle} The drawable's bounds. For compatibility with Scratch 2, we always use getAABB.
*/
getFenceBounds (drawable, result) {
return drawable.getFastBounds(result);
return drawable.getAABB(result);
}
/**

Binary file not shown.