Always use AABB for fence bounds

This commit is contained in:
adroitwhiz 2019-07-09 10:25:12 -04:00
parent cc5fea803e
commit b448aac1f3
2 changed files with 2 additions and 12 deletions

View File

@ -58,16 +58,6 @@ class BitmapSkin extends Skin {
return this._texture;
}
/**
* 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

@ -146,10 +146,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);
}
/**