diff options
author | 2021-09-15 15:50:10 +0700 | |
---|---|---|
committer | 2021-09-15 15:50:10 +0700 | |
commit | 5870cbb312ec5de1219b6983e09e460419d95912 (patch) | |
tree | add25c986ba0582628d921e45c2eae4006e19ee4 /graphics/src | |
parent | 93fec8d273ef8305e1c2456abe0c8ecd7a9d9407 (diff) | |
parent | c914b2a05be2c33ec936f63efd25daaf2b4c4739 (diff) | |
download | iced-5870cbb312ec5de1219b6983e09e460419d95912.tar.gz iced-5870cbb312ec5de1219b6983e09e460419d95912.tar.bz2 iced-5870cbb312ec5de1219b6983e09e460419d95912.zip |
Merge pull request #1046 from iced-rs/fix/empty-text-hit-test
Use `Option` to encode empty text case in hit test methods
Diffstat (limited to 'graphics/src')
-rw-r--r-- | graphics/src/backend.rs | 2 | ||||
-rw-r--r-- | graphics/src/widget/text.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/graphics/src/backend.rs b/graphics/src/backend.rs index 656949c5..7e0af2cc 100644 --- a/graphics/src/backend.rs +++ b/graphics/src/backend.rs @@ -60,7 +60,7 @@ pub trait Text { bounds: Size, point: Point, nearest_only: bool, - ) -> text::Hit; + ) -> Option<text::Hit>; } /// A graphics backend that supports image rendering. diff --git a/graphics/src/widget/text.rs b/graphics/src/widget/text.rs index c235f254..645c8414 100644 --- a/graphics/src/widget/text.rs +++ b/graphics/src/widget/text.rs @@ -43,7 +43,7 @@ where bounds: Size, point: Point, nearest_only: bool, - ) -> text::Hit { + ) -> Option<text::Hit> { self.backend().hit_test( content, size, |