servo / euclid

Geometry primitives (basic linear algebra) for Rust
Other
458 stars 102 forks source link

Propagate formatting parameters to each component when printing a Point #419

Closed Michael-F-Bryan closed 4 years ago

Michael-F-Bryan commented 4 years ago

I was printing an Arc and noticed a Point2D doesn't respect the format parameters (in this case 3 decimal places) to the x and y components.

Notice how the radius (f64), start_angle, and sweep_angle (euclid:::Angle) only have 3 decimal places.

println!("{:.3?}", arc);

// prints
Arc { 
  centre: (-3.66006961251359,-3.6605734446738905), 
  radius: 5.000, 
  start_angle: Angle { radians: 0.523 }, 
  sweep_angle: Angle { radians: -2.094 }, 
}
nical commented 4 years ago

Nice, thanks! @bors-servo r+

bors-servo commented 4 years ago

:pushpin: Commit 26160be has been approved by nical

bors-servo commented 4 years ago

:hourglass: Testing commit 26160be103511c87197ea05873f560925c0b21d5 with merge a7854f2af63cb728b072b78d2921a4292579baa4...

bors-servo commented 4 years ago

:sunny: Test successful - checks-travis Approved by: nical Pushing a7854f2af63cb728b072b78d2921a4292579baa4 to master...