ferroui_base/media/
text_hit_test_result.rs1use crate::media::CharacterHit;
2
3#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
5pub struct TextHitTestResult {
6 character_hit: CharacterHit,
7 text_position: i32,
8 is_inside: bool,
9 is_trailing: bool,
10}
11
12impl TextHitTestResult {
13 pub const fn new(character_hit: CharacterHit, text_position: i32, is_inside: bool, is_trailing: bool) -> Self {
14 Self { character_hit, text_position, is_inside, is_trailing }
15 }
16
17 pub const fn character_hit(&self) -> CharacterHit {
19 self.character_hit
20 }
21
22 pub const fn is_inside(&self) -> bool {
24 self.is_inside
25 }
26
27 pub const fn text_position(&self) -> i32 {
29 self.text_position
30 }
31
32 pub const fn is_trailing(&self) -> bool {
34 self.is_trailing
35 }
36}