use retroglyph_core::Size;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Density {
Compact,
Relaxed,
}
impl Density {
#[must_use]
pub const fn min_target_size(self) -> Size {
match self {
Self::Compact => Size::new(6, 3),
Self::Relaxed => Size::new(6, 1),
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn compact_rows_are_taller_than_relaxed_for_touch_targets() {
let compact = Density::Compact.min_target_size();
let relaxed = Density::Relaxed.min_target_size();
assert!(compact.height() > relaxed.height());
}
#[test]
fn relaxed_still_claims_more_than_a_single_cell_wide() {
let size = Density::Relaxed.min_target_size();
assert!(size.width() > 1);
}
}