diff options
Diffstat (limited to 'lib/widgets/common/extensions/geometry.dart')
| -rw-r--r-- | lib/widgets/common/extensions/geometry.dart | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/widgets/common/extensions/geometry.dart b/lib/widgets/common/extensions/geometry.dart new file mode 100644 index 0000000..3979c4a --- /dev/null +++ b/lib/widgets/common/extensions/geometry.dart @@ -0,0 +1,7 @@ +import 'dart:ui'; + +extension ExtraRect on Rect { + bool containsIncludingBottomRight(Offset offset, {double tolerance = 0}) { + return offset.dx >= left - tolerance && offset.dx <= right + tolerance && offset.dy >= top - tolerance && offset.dy <= bottom + tolerance; + } +} |
