Improve vertical alignment
juancampa opened this issue · 5 comments
I think this must be something specific to how you've styled the egui::Ui in which you are rendering the JsonTree, because I do not see this problem in this repo's examples, and I notice that the vertical line beneath the collapsing header icon is not present in your screenshot.
Are you able to provide a reproduction? I suspect it's because ui.spacing().icon_width has changed - changing this in the demo causes a similar misalignment.
Interesting, I didn't change icon_width but I did change the font size (and the font itself). Perhaps I need to adjust icon_width accordingly
To be clear, you don't see either of the misalignments?
I am not seeing a misalignment in the repo's examples when changing the font size and style alone, e.g. setting the following on a JsonTree:
.style(JsonTreeStyle {
font_id: Some(FontId::proportional(40.0)),
..Default::default()
})
Did you change something else?
Wondering if we should set an appropriately scaled icon_width based on something in the Ui.

