Make Texture.add() firstFrame check more explicit

Fixes issue #4088 where a SpriteSheet created from a trimmed texture atlas frame returns the second frame when the first frame is requested.
This commit is contained in:
Cirras 2018-10-05 04:29:17 +10:00 committed by GitHub
parent 2a1ea30cb7
commit 0d7d828311
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -154,7 +154,7 @@ var Texture = new Class({
// This is used to ensure we don't spam the display with entire // This is used to ensure we don't spam the display with entire
// atlases of sprite sheets, but instead just the first frame of them // atlases of sprite sheets, but instead just the first frame of them
// should the dev incorrectly specify the frame index // should the dev incorrectly specify the frame index
if (this.frameTotal === 1) if (this.firstFrame === '__BASE')
{ {
this.firstFrame = name; this.firstFrame = name;
} }