Skip to content

Commit

Permalink
Calculation tooltip position
Browse files Browse the repository at this point in the history
  • Loading branch information
faiyaz-shaikh committed Feb 24, 2022
1 parent 617e95a commit e316d99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- Fixed [#173](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/173) - showArrow not working
- Fixed [#150](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/150) - Add condition for determine state is active
- Fixed [#121](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/121) - SlideTransition widget in tooltip_widget.dart is constantly rebuildung even after the showcasing is supposed to have stopped
- Fixed [#152](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/152) - Calculation of tooltip position

## [1.1.4] - November 26, 2021

Expand Down
5 changes: 4 additions & 1 deletion lib/src/tooltip_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ class _ToolTipWidgetState extends State<ToolTipWidget>
bool isCloseToTopOrBottom(Offset position) {
var height = 120.0;
height = widget.contentHeight ?? height;
return (widget.screenSize!.height - position.dy) <= height;
var bottomPosition = position.dy + (widget.position!.getHeight() / 2);
var topPosition = position.dy - (widget.position!.getHeight() / 2);
return (widget.screenSize!.height - bottomPosition) <= height &&
topPosition >= height;
}

String findPositionForContent(Offset position) {
Expand Down

0 comments on commit e316d99

Please sign in to comment.