Nuklear icon indicating copy to clipboard operation
Nuklear copied to clipboard

Fix nk_draw_button_text_* to use nk_flags align passed from nk_menu_item_image_text etc

Open wuxxerno opened this issue 2 years ago • 2 comments

nk_flags align were lost in transit and not passed to the final draw functions, where a NK_TEXT_CENTERED was in its place.

wuxxerno avatar Mar 06 '23 16:03 wuxxerno

Could this not use the text_alignment from the passed in nk_style_button* ? Rather than having a new argument? I had a local fix to this where the alignment passed to eg. nk_button_image_label would determine whether the text was to the left or right of the image, and the relevant button style text_alignment would determine the alignment of the text itself.

Dodzey avatar Aug 31 '24 14:08 Dodzey

I have implemented an alternative to this here: https://github.com/Immediate-Mode-UI/Nuklear/pull/674 In my implementation the align passed to nk_button_image_label etc continues to switch from text to right of image or text to left of image, and the button style text_alignment flag is used to select the alignment of the text within the 'content' region of the button.

Dodzey avatar Aug 31 '24 18:08 Dodzey