emilk / egui

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
https://www.egui.rs/
Apache License 2.0
20.61k stars 1.49k forks source link

Nitpick: give at least two decimals of information for a pos2 in the Debug trait #4665

Closed gitsmol closed 1 week ago

gitsmol commented 1 week ago

As Emil has written, debugging layout in egui can be tricky. Extra tricky is when working with Pos2 in a coordinate system normalized to 0..=1. In this case, the debugging output for Pos2 formatted as {:.1} gives too little information. This is especially apparent when writing tests:

assertion `left == right` failed
  left: [0.2 0.2]
 right: [0.2 0.2]

I would humbly request for the Debug trait to give at least 2 decimals of the x/y values.

gitsmol commented 1 week ago

Much appreciated!