1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-28 07:23:13 -04:00

Make Debug for Rect heed precision

This commit is contained in:
Emil Ernerfeldt
2025-03-30 20:05:09 +02:00
parent 8a33a6a6ce
commit 59442ca4d5

View File

@@ -710,7 +710,11 @@ impl Rect {
impl fmt::Debug for Rect {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "[{:?} - {:?}]", self.min, self.max)
if let Some(precision) = f.precision() {
write!(f, "[{1:.0$?} - {2:.0$?}]", precision, self.min, self.max)
} else {
write!(f, "[{:?} - {:?}]", self.min, self.max)
}
}
}