freya_core/style/scale.rs
1#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2#[derive(Debug, Default, Clone, PartialEq, Copy)]
3pub struct Scale {
4 pub x: f32,
5 pub y: f32,
6}
7
8impl From<(f32, f32)> for Scale {
9 fn from((x, y): (f32, f32)) -> Self {
10 Scale { x, y }
11 }
12}
13
14impl From<f32> for Scale {
15 fn from(x_y: f32) -> Self {
16 Scale { x: x_y, y: x_y }
17 }
18}