diff options
author | 2021-11-07 15:15:33 +0700 | |
---|---|---|
committer | 2021-11-07 15:15:33 +0700 | |
commit | eafad00af2a9bae9f3ed8124e2a6f6e59ee5d253 (patch) | |
tree | 76413948c9c9723075189d51d4c2e02c0f8fdd23 /core | |
parent | 61c747b53589d98f477fea95f85d2ea5349666d3 (diff) | |
parent | 07b5097bc92ced376d09115d787ff1d2ebe00836 (diff) | |
download | iced-eafad00af2a9bae9f3ed8124e2a6f6e59ee5d253.tar.gz iced-eafad00af2a9bae9f3ed8124e2a6f6e59ee5d253.tar.bz2 iced-eafad00af2a9bae9f3ed8124e2a6f6e59ee5d253.zip |
Merge pull request #1110 from iced-rs/remove-renderer-traits
Reduce the surface of the `Renderer` APIs
Diffstat (limited to 'core')
-rw-r--r-- | core/src/lib.rs | 1 | ||||
-rw-r--r-- | core/src/text.rs | 29 |
2 files changed, 0 insertions, 30 deletions
diff --git a/core/src/lib.rs b/core/src/lib.rs index 1f58a8cd..cd505239 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -17,7 +17,6 @@ pub mod alignment; pub mod keyboard; pub mod mouse; -pub mod text; mod background; mod color; diff --git a/core/src/text.rs b/core/src/text.rs deleted file mode 100644 index e5d0092e..00000000 --- a/core/src/text.rs +++ /dev/null @@ -1,29 +0,0 @@ -//! Draw and interact with text. -use crate::Vector; - -/// The result of hit testing on text. -#[derive(Debug, Clone, Copy, PartialEq)] -pub enum Hit { - /// The point was within the bounds of the returned character index. - CharOffset(usize), - /// The provided point was not within the bounds of a glyph. The index - /// of the character with the closest centeroid position is returned, - /// as well as its delta. - NearestCharOffset(usize, Vector), -} - -impl Hit { - /// Computes the cursor position corresponding to this [`HitTestResult`] . - pub fn cursor(self) -> usize { - match self { - Self::CharOffset(i) => i, - Self::NearestCharOffset(i, delta) => { - if delta.x > f32::EPSILON { - i + 1 - } else { - i - } - } - } - } -} |