Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

murl-digital
Copy link
Contributor

@murl-digital murl-digital commented Jun 18, 2024

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

@emilk
Copy link
Owner

emilk commented Jun 18, 2024

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
Copy link
Contributor Author

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

@Mingun
Copy link
Contributor

Mingun commented Jun 18, 2024

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

@murl-digital
Copy link
Contributor Author

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

@emilk emilk added the emath Relates to the emath crate label Jun 18, 2024
@emilk emilk changed the title change number of decimal digits to 3 Make Debug format of Vec2/Pos2/Rot2 respect user precision Jun 18, 2024
@emilk emilk merged commit dd52291 into emilk:master Jun 18, 2024
18 of 20 checks passed
hacknus pushed a commit to hacknus/egui that referenced this pull request Oct 30, 2024
…#4671)

* closes emilk#4665

pretty self explanatory, i opted for 3 instead of 2 since i think that's
what display does
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emath Relates to the emath crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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