1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
use crate::{font::FontId, rusttype::Scale};
use std::f32;
pub type Color = [f32; 4];
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct SectionGeometry {
pub screen_position: (f32, f32),
pub bounds: (f32, f32),
}
impl Default for SectionGeometry {
#[inline]
fn default() -> Self {
Self {
screen_position: (0.0, 0.0),
bounds: (f32::INFINITY, f32::INFINITY),
}
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct SectionText<'a> {
pub text: &'a str,
pub scale: Scale,
pub color: Color,
pub font_id: FontId,
}
impl Default for SectionText<'static> {
#[inline]
fn default() -> Self {
Self {
text: "",
scale: Scale::uniform(16.0),
color: [0.0, 0.0, 0.0, 1.0],
font_id: FontId::default(),
}
}
}