Skip to content

Commit

Permalink
fix: hide toolbar when the selection area is invisible
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasXu0 committed Aug 29, 2023
1 parent 26a3f7b commit 9e110bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/src/editor/toolbar/desktop/floating_toolbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ class _FloatingToolbarState extends State<FloatingToolbar>

final rect = _findSuitableRect(rects);
final (left, top, right) = calculateToolbarOffset(rect);
// if the selection is not visible, then don't show the toolbar.
if (top <= floatingToolbarHeight || (left == 0 && right == 0)) {
return;
}
_toolbarContainer = OverlayEntry(
builder: (context) {
return Positioned(
Expand Down

0 comments on commit 9e110bd

Please sign in to comment.