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

Make `Debug` format of `Vec2/Pos2/Rot2` respect user precision #4671

Closed murl-digital closed 1 week ago

murl-digital commented 1 week ago

pretty self explanatory, i opted for 3 instead of 2 since i think that's what display does

emilk commented 1 week ago

Almost always Pos2 and Vec2 is in in the unit of ui points, where 1 decimal is enough. Is there a way to make {pos:.3} work for users that want to opt-in to more decimals?

murl-digital commented 1 week ago

i could put it behind a feature gate, that wouldn't be hard to do at all

Mingun commented 1 week ago

I think it should be possible to respect the formatting flags that user can provide like he can do that for f64

murl-digital commented 1 week ago

I think it should be possible to respect the formatting flags that user can provide like he can do that for f64

it is indeed possible, was a pretty quick change to respect it