mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
Make Debug for Rect heed precision
This commit is contained in:
@@ -710,7 +710,11 @@ impl Rect {
|
|||||||
|
|
||||||
impl fmt::Debug for Rect {
|
impl fmt::Debug for Rect {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
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