DIRECTOR: release previous widget when setting new castmember.

This commit is contained in:
ysj1173886760 2021-08-12 14:45:57 +08:00
parent 1724d0f2dc
commit dcabde4f8e

View File

@ -297,6 +297,10 @@ Common::Rect Channel::getBbox(bool unstretched) {
}
void Channel::setCast(CastMemberID memberID) {
// release previous widget
if (_sprite->_cast)
_sprite->_cast->releaseWidget();
_sprite->setCast(memberID);
_width = _sprite->_width;
_height = _sprite->_height;