Skip to main content

euv_ui/component/rating/view/
impl.rs

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