mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 15:47:26 +00:00
parent
34332cc8b3
commit
b0c7ac41f0
2 changed files with 23 additions and 12 deletions
|
@ -326,8 +326,9 @@ pub(super) fn draw_rounded_rectangle_line(
|
|||
struct Shifted(u32);
|
||||
impl Shifted {
|
||||
const ONE: Self = Shifted(1 << 4);
|
||||
pub fn new(value: impl TryInto<u32>) -> Self {
|
||||
Self(value.try_into().map_err(|_| ()).unwrap() << 4)
|
||||
#[track_caller]
|
||||
pub fn new(value: impl TryInto<u32> + core::fmt::Debug + Copy) -> Self {
|
||||
Self(value.try_into().unwrap_or_else(|_| panic!("Overflow {value:?}")) << 4)
|
||||
}
|
||||
pub fn floor(self) -> u32 {
|
||||
self.0 >> 4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue