Fix Point display to respect formatting parameters

This changes Point formatting to match formatting of other geometry types, including Isometry, Scale, and Rotation.
Fixes issue #1115 since it passes through the desired precision formatting parameter.
This commit is contained in:
Owen Brooks 2022-06-06 18:32:41 +10:00
parent dd801567f2
commit 9036e87dd6
1 changed files with 3 additions and 9 deletions

View File

@ -458,16 +458,10 @@ where
DefaultAllocator: Allocator<T, D>, DefaultAllocator: Allocator<T, D>,
{ {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{{")?; let precision = f.precision().unwrap_or(3);
let mut it = self.coords.iter();
write!(f, "{}", *it.next().unwrap())?;
for comp in it {
write!(f, ", {}", *comp)?;
}
write!(f, "Point {{")?;
write!(f, "{:.*}", precision, self.coords)?;
write!(f, "}}") write!(f, "}}")
} }
} }