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:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user