[raygui] empty string will cause the draw of a title-bar, but nil doesn't

This commit is contained in:
JupiterRider 2024-05-16 19:05:18 +02:00
parent e824a9b663
commit c212c33886

View file

@ -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)
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)