Skip to content

Commit

Permalink
Fixed incorrect rotation in WanderingCubes animation
Browse files Browse the repository at this point in the history
The WanderingCubes animation was rotating incorrectly due to a miscalculation in the transformation matrix. Adjusted the rotation logic to align with the intended design, ensuring smooth and accurate animation.

Closes jogboms#106
  • Loading branch information
muhitmahmudbs23 committed Jan 27, 2025
1 parent 360fa80 commit 5f15294
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/src/wandering_cubes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,20 @@ class _SpinKitWanderingCubesState extends State<SpinKitWanderingCubes> with Sing
Matrix4 tTranslate;
if (offset == true) {
tTranslate = Matrix4.identity()
..translate(_translate3.value, 0.0)
..translate(0.0, _translate2.value)
..translate(0.0, _translate4.value)
..translate(_translate1.value, 0.0);
..translate(0.0, -_translate1.value)
..translate(_translate2.value, 0.0)
..translate(0.0, -_translate3.value)
..translate(_translate4.value, 0.0);
} else {
tTranslate = Matrix4.identity()
..translate(0.0, _translate3.value)
..translate(0.0, _translate1.value)
..translate(-_translate2.value, 0.0)
..translate(-_translate4.value, 0.0)
..translate(0.0, _translate1.value);
..translate(0.0, _translate3.value)
..translate(-_translate4.value, 0.0);
}

return Positioned(
top: 0.0,
top: offset == true ? widget.offset : 0.0,
left: offset == true ? 0.0 : widget.offset,
child: Transform(
transform: tTranslate,
Expand Down

0 comments on commit 5f15294

Please sign in to comment.