diff --git a/CHANGELOG.md b/CHANGELOG.md index 51c77fc9..c648d228 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/src/tooltip_widget.dart b/lib/src/tooltip_widget.dart index e8ceeafe..8f277a61 100644 --- a/lib/src/tooltip_widget.dart +++ b/lib/src/tooltip_widget.dart @@ -82,7 +82,10 @@ class _ToolTipWidgetState extends State 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) {