From 7614127d3641cf3224798c2f0ff07b6ae57d9a53 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 26 Aug 2021 14:41:33 +0700 Subject: Rename `HitTestResult` to `Hit` ... and also move it to a new `text` module in `iced_core` --- graphics/src/backend.rs | 5 +++-- graphics/src/lib.rs | 4 ++-- graphics/src/widget/text.rs | 5 ++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'graphics') diff --git a/graphics/src/backend.rs b/graphics/src/backend.rs index 94124509..656949c5 100644 --- a/graphics/src/backend.rs +++ b/graphics/src/backend.rs @@ -1,7 +1,8 @@ //! Write a graphics backend. use iced_native::image; use iced_native::svg; -use iced_native::{Font, HitTestResult, Point, Size}; +use iced_native::text; +use iced_native::{Font, Point, Size}; /// The graphics backend of a [`Renderer`]. /// @@ -59,7 +60,7 @@ pub trait Text { bounds: Size, point: Point, nearest_only: bool, - ) -> HitTestResult; + ) -> text::Hit; } /// A graphics backend that supports image rendering. diff --git a/graphics/src/lib.rs b/graphics/src/lib.rs index 687294fc..14388653 100644 --- a/graphics/src/lib.rs +++ b/graphics/src/lib.rs @@ -40,6 +40,6 @@ pub use transformation::Transformation; pub use viewport::Viewport; pub use iced_native::{ - Background, Color, Font, HitTestResult, HorizontalAlignment, Point, - Rectangle, Size, Vector, VerticalAlignment, + Background, Color, Font, HorizontalAlignment, Point, Rectangle, Size, + Vector, VerticalAlignment, }; diff --git a/graphics/src/widget/text.rs b/graphics/src/widget/text.rs index e1b4e4e8..c235f254 100644 --- a/graphics/src/widget/text.rs +++ b/graphics/src/widget/text.rs @@ -4,8 +4,7 @@ use crate::{Primitive, Renderer}; use iced_native::mouse; use iced_native::text; use iced_native::{ - Color, Font, HitTestResult, HorizontalAlignment, Point, Rectangle, Size, - VerticalAlignment, + Color, Font, HorizontalAlignment, Point, Rectangle, Size, VerticalAlignment, }; /// A paragraph of text. @@ -44,7 +43,7 @@ where bounds: Size, point: Point, nearest_only: bool, - ) -> HitTestResult { + ) -> text::Hit { self.backend().hit_test( content, size, -- cgit