use azul_core::geom::LogicalSize;
#[derive(Debug, Clone, Default)]
#[repr(C)]
pub struct ScrollbarRequirements {
pub needs_horizontal: bool,
pub needs_vertical: bool,
pub scrollbar_width: f32,
pub scrollbar_height: f32,
}
impl ScrollbarRequirements {
pub fn needs_reflow(&self) -> bool {
self.scrollbar_width > 0.0 || self.scrollbar_height > 0.0
}
pub fn shrink_size(&self, size: LogicalSize) -> LogicalSize {
LogicalSize {
width: (size.width - self.scrollbar_width).max(0.0),
height: (size.height - self.scrollbar_height).max(0.0),
}
}
}