Merge branch '4.1' into 4.2-beta

This commit is contained in:
Mario Zechner 2023-03-02 17:48:48 +01:00
commit 7cfa99d4ae

View File

@ -373,6 +373,18 @@ class _SpineWidgetState extends State<SpineWidget> {
}
}
@override
void didUpdateWidget(covariant SpineWidget oldWidget) {
super.didUpdateWidget(oldWidget);
widget._controller._drawable?.dispose();
_drawable = null;
if (widget._assetType == _AssetType.drawable) {
loadDrawable(widget._drawable!);
} else {
loadFromAsset(widget._bundle, widget._atlasFile!, widget._skeletonFile!, widget._assetType);
}
}
void loadDrawable(SkeletonDrawable drawable) {
_drawable = drawable;
_computedBounds = widget._boundsProvider.computeBounds(drawable);