Support for rounded rectangles & borders (not the best implementation...)

This commit is contained in:
2024-06-30 13:37:24 -04:00
parent 8ecfd7407e
commit 0655ade456
8 changed files with 195 additions and 49 deletions

View File

@ -10,10 +10,10 @@ Corner :: enum i32 {
_01,
_10,
_11,
TopLeft = _00,
TopRight = _01,
BottomLeft = _10,
BottomRight = _11,
Top_Left = _00,
Top_Right = _01,
Bottom_Left = _10,
Bottom_Right = _11,
Count = 4,
}

View File

@ -1,5 +1,9 @@
package sectr
BoxCorners :: struct {
top_left, top_right, bottom_right, bottom_left : f32,
}
// TODO(Ed): We problably can embedd this info into the UI_Layout with the regular text_alignment
UI_TextAlign :: enum u32 {
Left,
@ -20,7 +24,6 @@ UI_Style :: struct {
bg_color : RGBA8,
border_color : RGBA8,
// TODO(Ed): We cannot support individual corners unless we add it to raylib (or finally change the rendering backend)
corner_radii : [Corner.Count]f32,
// TODO(Ed) : Add support for this eventually

View File

@ -277,7 +277,7 @@ ui_resizable_handles :: proc( parent : ^UI_Widget, pos : ^Vec2, size : ^Vec2,
style := UI_Style {
bg_color = Color_Transparent,
border_color = Color_Transparent,
corner_radii = {5, 0, 0, 0},
corner_radii = {5, 5, 5, 5},
blur_size = 0,
font = get_state().default_font,
text_color = app_color.text_default,