Skip to content

Commit

Permalink
[raygui] empty string will cause the draw of a title-bar, but nil doe…
Browse files Browse the repository at this point in the history
…sn't
  • Loading branch information
JupiterRider committed May 16, 2024
1 parent e824a9b commit c212c33
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions raygui/raygui.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,11 @@ func ScrollPanel(bounds rl.Rectangle, text string, content rl.Rectangle, scroll
cbounds.y = C.float(bounds.Y)
cbounds.width = C.float(bounds.Width)
cbounds.height = C.float(bounds.Height)
ctext := C.CString(text)
defer C.free(unsafe.Pointer(ctext))
var ctext *C.char
if len(text) > 0 {
ctext = C.CString(text)
defer C.free(unsafe.Pointer(ctext))
}
var ccontent C.struct_Rectangle
ccontent.x = C.float(content.X)
ccontent.y = C.float(content.Y)
Expand Down

0 comments on commit c212c33

Please sign in to comment.