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
52
53
#[derive(Debug, Clone)]
pub struct Settings {
pub font_size: usize,
pub font_family: String,
pub fill_color: String,
pub background: String,
pub stroke_color: String,
pub stroke_width: f32,
pub scale: f32,
pub enhance_circuitries: bool,
pub include_backdrop: bool,
pub include_styles: bool,
pub include_defs: bool,
pub merge_line_with_shapes: bool,
}
impl Settings {
pub fn scale_inverse(&self) -> f32 {
1.0 / self.scale
}
}
impl Default for Settings {
fn default() -> Self {
Settings {
font_size: 14,
font_family: "monospace".into(),
fill_color: "black".into(),
background: "white".into(),
stroke_color: "black".into(),
stroke_width: 2.0,
scale: 8.0,
enhance_circuitries: true,
include_backdrop: true,
include_styles: true,
include_defs: true,
merge_line_with_shapes: false,
}
}
}