diff --git a/spine-flutter/CHANGELOG.md b/spine-flutter/CHANGELOG.md index 69b28344f..e6cb14e33 100644 --- a/spine-flutter/CHANGELOG.md +++ b/spine-flutter/CHANGELOG.md @@ -1,3 +1,6 @@ +# 4.2.27 +- Fixes clipping in case of colinear clipping edges. + # 4.2.26 - `Skeleton.getBounds()` takes clipping into consideration. diff --git a/spine-flutter/example/lib/simple_animation.dart b/spine-flutter/example/lib/simple_animation.dart index f9a96ecdf..0c34c777c 100644 --- a/spine-flutter/example/lib/simple_animation.dart +++ b/spine-flutter/example/lib/simple_animation.dart @@ -37,8 +37,12 @@ class SimpleAnimation extends StatelessWidget { Widget build(BuildContext context) { reportLeaks(); final controller = SpineWidgetController(onInitialized: (controller) { - // Set the walk animation on track 0, let it loop - controller.animationState.setAnimationByName(0, "walk", true); + // Set the default mixing time between animations + controller.animationState.getData().setDefaultMix(0.2); + // Set the portal animation on track 0 + controller.animationState.setAnimationByName(0, "portal", true); + // Queue the run animation after the portal animation + controller.animationState.addAnimationByName(0, "run", true, 0); }); return Scaffold( diff --git a/spine-flutter/lib/assets/libspine_flutter.wasm b/spine-flutter/lib/assets/libspine_flutter.wasm index 56a1c920a..163d45cd0 100755 Binary files a/spine-flutter/lib/assets/libspine_flutter.wasm and b/spine-flutter/lib/assets/libspine_flutter.wasm differ diff --git a/spine-flutter/lib/spine_widget.dart b/spine-flutter/lib/spine_widget.dart index 113e80593..aed34abac 100644 --- a/spine-flutter/lib/spine_widget.dart +++ b/spine-flutter/lib/spine_widget.dart @@ -483,6 +483,7 @@ class _SpineRenderObject extends RenderBox { Bounds _bounds; bool _sizedByBounds; bool _disposed = false; + bool _firstUpdated = false; _SpineRenderObject(this._skeletonDrawable, this._controller, this._fit, this._alignment, this._bounds, this._sizedByBounds); @@ -618,6 +619,7 @@ class _SpineRenderObject extends RenderBox { markNeedsPaint(); _scheduleFrame(); } + _firstUpdated = true; } void _setCanvasTransform(Canvas canvas, Offset offset) { @@ -669,9 +671,11 @@ class _SpineRenderObject extends RenderBox { canvas.save(); _setCanvasTransform(canvas, offset); - _controller.onBeforePaint?.call(_controller, canvas); - final commands = _skeletonDrawable.renderToCanvas(canvas); - _controller.onAfterPaint?.call(_controller, canvas, commands); + if (_firstUpdated) { + _controller.onBeforePaint?.call(_controller, canvas); + final commands = _skeletonDrawable.renderToCanvas(canvas); + _controller.onAfterPaint?.call(_controller, canvas, commands); + } canvas.restore(); } diff --git a/spine-flutter/pubspec.yaml b/spine-flutter/pubspec.yaml index beacc15ea..949f5fc24 100644 --- a/spine-flutter/pubspec.yaml +++ b/spine-flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: spine_flutter description: The official Spine Flutter Runtime to load, display and interact with Spine animations. -version: 4.2.26 +version: 4.2.27 homepage: https://esotericsoftware.com repository: https://github.com/esotericsoftware/spine-runtimes issue_tracker: https://github.com/esotericsoftware/spine-runtimes/issues