Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix axis labels overlap with axis ticks (#57)
Currently, when you have custom axis labels, you will end up with the following: ![plot_clipps](https://github.com/user-attachments/assets/a0bb2637-fae3-4fbc-8c2e-bdcc103eeb6f) What i would expect (and what this pr does) is that the axis labels do not overlap with the ticks. This PR does two things: * First, it adds a top axis to the custom axis demo, so that the demo can be used to verify that its not clipping anymore, in all axis configurations. * Second, it fixes the overlap by adding the "text_thickness" to the axis thickness in the axis' ui() function. This results in the following: ![no_clip_fixed](https://github.com/user-attachments/assets/80f5cfea-a614-46fc-a9c9-dbb10778ac21) A possible optimization would be to figure out the max tick thickness around the axis label, instead of using the maximal thickness - that could result in a tad smaller axis for plots where the order of magnitude changes in the current view. However, with this PR, the issue is fixed to a level where i'd say its usable. I have * run check.sh locally and it went rhough * tested it using the demo * thrown this pr into a larger project that uses egui_plot and have not seen any issues arise from this. Thanks for your time! EDIT: as is tradition, i immediately noticed something of as soon as i wrote all this. I have updated the image and am gonna force-push a fix in a sec. ~mkalte
- Loading branch information