Skip to main content

euv_ui/component/rating/view/
impl.rs

1use super::*;
2
3impl EuvRatingSize {
4    /// Returns the star glyph edge length in pixels for this size.
5    ///
6    /// # Returns
7    ///
8    /// - `i32` - The edge length in pixels: 14 for `Sm`, 18 for `Md`, 24 for
9    ///   `Lg`.
10    pub fn px(&self) -> i32 {
11        match self {
12            EuvRatingSize::Sm => 14,
13            EuvRatingSize::Md => 18,
14            EuvRatingSize::Lg => 24,
15        }
16    }
17}