Skip to content

Commit

Permalink
Calculation tooltip position (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
faiyaz-shaikh authored Feb 25, 2022
1 parent 248d1fe commit 375cf71
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

- 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 rebuilding even after the showcasing is supposed to have stopped
- 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
- Fixed [#182](https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/issues/182) - Not providing blurValue causes Exception: Please provide ShowCaseView context

## [1.1.4] - November 26, 2021
Expand Down
8 changes: 7 additions & 1 deletion lib/src/tooltip_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ class _ToolTipWidgetState extends State<ToolTipWidget>
bool isCloseToTopOrBottom(Offset position) {
var height = 120.0;
height = widget.contentHeight ?? height;
return (widget.screenSize!.height - position.dy) <= height;
final bottomPosition =
position.dy + ((widget.position?.getHeight() ?? 0) / 2);
final topPosition = position.dy - ((widget.position?.getHeight() ?? 0) / 2);
return ((widget.screenSize?.height ?? MediaQuery.of(context).size.height) -
bottomPosition) <=
height &&
topPosition >= height;
}

String findPositionForContent(Offset position) {
Expand Down

0 comments on commit 375cf71

Please sign in to comment.