Use Option to encode empty text case in hit test methods
This commit is contained in:
parent
93fec8d273
commit
643500bbdf
10 changed files with 59 additions and 52 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ where
|
|||
bounds: Size,
|
||||
point: Point,
|
||||
nearest_only: bool,
|
||||
) -> text::Hit {
|
||||
) -> Option<text::Hit> {
|
||||
self.backend().hit_test(
|
||||
content,
|
||||
size,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue