Add debug statements

to help debugging #6432
This commit is contained in:
Olivier Goffart 2024-11-07 17:24:06 +01:00
parent 34332cc8b3
commit b0c7ac41f0
2 changed files with 23 additions and 12 deletions

View file

@ -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