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:
parent
dd801567f2
commit
9036e87dd6
|
@ -458,16 +458,10 @@ where
|
|||
DefaultAllocator: Allocator<T, D>,
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{{")?;
|
||||
|
||||
let mut it = self.coords.iter();
|
||||
|
||||
write!(f, "{}", *it.next().unwrap())?;
|
||||
|
||||
for comp in it {
|
||||
write!(f, ", {}", *comp)?;
|
||||
}
|
||||
let precision = f.precision().unwrap_or(3);
|
||||
|
||||
write!(f, "Point {{")?;
|
||||
write!(f, "{:.*}", precision, self.coords)?;
|
||||
write!(f, "}}")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue