rguistyler icon indicating copy to clipboard operation
rguistyler copied to clipboard

Button BORDER_WIDTH is not being saved into rgs file

Open ssoher opened this issue 1 year ago • 5 comments

rGuiStyler may not be saving the button border width to the rgs file. After loading the style and making sure that guiStyleLoaded is true, GuiGetStyle(BUTTON, BORDER_WIDTH) always returns 2 even though it was set to 1 and saved.

ssoher avatar Apr 02 '24 05:04 ssoher

I think the issue is related to raygui lazy initialization that overwrites button border width. How are you loading the new gui style?

raysan5 avatar Apr 03 '24 10:04 raysan5

GuiLoadStyle("./asset/gui_style/gui_style.rgs"); in the main function after I raylib InitWindow, before entering the main loop

ssoher avatar Apr 03 '24 13:04 ssoher

@ssoher I updated raygui, now it should work as expected, please, could you try it?

raysan5 avatar Apr 03 '24 16:04 raysan5

Thank you @raysan5

  • Opened my style to make sure button width is 1, it shows up as 2. Made it 1 and save. Closed rGuiStyler, re-opened, opened the same style file and button border width is reset back to 2 again.
  • Pulled the latest raygui commit (https://github.com/raysan5/raygui/commit/e3f67f3c02300bf927a343d767d51b9b1ffe41a9) built my application, borders load up as 2.

I feel it has something to do with rGuiStyle serialization code but it's just a guess, didn't look at the code myself.

ssoher avatar Apr 03 '24 16:04 ssoher

Here is the rgs file I'm observing this problem with if it helps you debug

gui_style.zip

ssoher avatar Apr 03 '24 16:04 ssoher