Skip to content

Commit

Permalink
Merge pull request #46 from rasitayaz/dev
Browse files Browse the repository at this point in the history
update to 3.1.2
  • Loading branch information
rasitayaz authored Dec 7, 2023
2 parents 70c1b28 + 6f968f3 commit 16cbce6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 3.1.2

* Small bug fixes.

# 3.1.1

* Fixed timers not being disposed properly, causing errors during navigation.
Expand Down
18 changes: 11 additions & 7 deletions lib/src/bouncing_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ class _BouncingWidgetState extends State<BouncingWidget> {
return AnimatedBuilder(
animation: widget.animation,
builder: (context, child) {
final sizeWrapper = _WidgetSizeWrapper(
onSizeChange: (newSize) {
if (lastSize == newSize) return;
setState(() => lastSize = newSize);
},
child: widget.child,
);

if (lastSize == Size.zero) return sizeWrapper;

final v = 0.5 / max(lastSize.width, lastSize.height);
final transform = Matrix4.identity()..setEntry(3, 2, v);

Expand All @@ -59,13 +69,7 @@ class _BouncingWidgetState extends State<BouncingWidget> {
return Transform(
transform: transform,
origin: Offset(lastSize.width / 2, lastSize.height / 2),
child: _WidgetSizeWrapper(
onSizeChange: (newSize) {
if (lastSize == newSize) return;
setState(() => lastSize = newSize);
},
child: widget.child,
),
child: sizeWrapper,
);
},
child: widget.child,
Expand Down
5 changes: 4 additions & 1 deletion lib/src/pie_menu_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ class _PieMenuCoreState extends State<PieMenuCore>

if (rightClicked && !_theme.rightClickShowsMenu) return;

_bounce();
if (_theme.delayDuration < const Duration(milliseconds: 100) ||
rightClicked) {
_bounce();
}

if (leftClicked && !_theme.leftClickShowsMenu) return;

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pie_menu
description: A Flutter package providing a highly customizable circular/radial context menu
version: 3.1.1
version: 3.1.2
homepage: https://github.com/rasitayaz/flutter-pie-menu
repository: https://github.com/rasitayaz/flutter-pie-menu
issue_tracker: https://github.com/rasitayaz/flutter-pie-menu/issues
Expand Down

0 comments on commit 16cbce6

Please sign in to comment.