Skip to content

Commit 3612461

Browse files
authored
Merge pull request #478 from adroitwhiz/fix-fence-bounds
Always use getAABB for fence bounds
2 parents 7c710c0 + 60e7e56 commit 3612461

File tree

3 files changed

+2
-12
lines changed

3 files changed

+2
-12
lines changed

src/BitmapSkin.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,6 @@ class BitmapSkin extends Skin {
5656
return this._texture || super.getTexture();
5757
}
5858

59-
/**
60-
* Get the bounds of the drawable for determining its fenced position.
61-
* @param {Array<number>} drawable - The Drawable instance this skin is using.
62-
* @param {?Rectangle} result - Optional destination for bounds calculation.
63-
* @return {!Rectangle} The drawable's bounds. For compatibility with Scratch 2, we always use getAABB for bitmaps.
64-
*/
65-
getFenceBounds (drawable, result) {
66-
return drawable.getAABB(result);
67-
}
68-
6959
/**
7060
* Set the contents of this skin to a snapshot of the provided bitmap data.
7161
* @param {ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} bitmapData - new contents for this skin.

src/Skin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ class Skin extends EventEmitter {
143143
* Get the bounds of the drawable for determining its fenced position.
144144
* @param {Array<number>} drawable - The Drawable instance this skin is using.
145145
* @param {?Rectangle} result - Optional destination for bounds calculation.
146-
* @return {!Rectangle} The drawable's bounds.
146+
* @return {!Rectangle} The drawable's bounds. For compatibility with Scratch 2, we always use getAABB.
147147
*/
148148
getFenceBounds (drawable, result) {
149-
return drawable.getFastBounds(result);
149+
return drawable.getAABB(result);
150150
}
151151

152152
/**
54.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)