diff --git a/CHANGELOG.md b/CHANGELOG.md index 24276954..781f63f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d ### Fixed - Fix text boxes in the Palette Editor calculating color incorrectly. +- Fix default object sprites retaining dimensions and transparency of the previous sprite. ## [5.1.1] - 2023-02-20 ### Added diff --git a/src/core/events.cpp b/src/core/events.cpp index fdce7893..331eb69f 100644 --- a/src/core/events.cpp +++ b/src/core/events.cpp @@ -244,6 +244,9 @@ void ObjectEvent::loadPixmap(Project *project) { // No sprite associated with this gfx constant. // Use default sprite instead. this->pixmap = project->entitiesPixmap.copy(0, 0, 16, 16); + this->spriteWidth = 16; + this->spriteHeight = 16; + this->usingSprite = false; } else { this->setFrameFromMovement(project->facingDirections.value(this->movement)); this->setPixmapFromSpritesheet(eventGfx->spritesheet, eventGfx->spriteWidth, eventGfx->spriteHeight, eventGfx->inanimate); @@ -387,6 +390,9 @@ void CloneObjectEvent::loadPixmap(Project *project) { // No sprite associated with this gfx constant. // Use default sprite instead. this->pixmap = project->entitiesPixmap.copy(0, 0, 16, 16); + this->spriteWidth = 16; + this->spriteHeight = 16; + this->usingSprite = false; } else { this->setFrameFromMovement(project->facingDirections.value(this->movement)); this->setPixmapFromSpritesheet(eventGfx->spritesheet, eventGfx->spriteWidth, eventGfx->spriteHeight, eventGfx->inanimate);