Merge pull request #389 from JupiterRider/master

[raygui] don't trim leading and trailing white spaces (fix #351)
This commit is contained in:
Milan Nikolic 2024-05-18 18:08:52 +02:00 committed by GitHub
commit 5314a4a209
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -970,7 +970,7 @@ func TextBox(bounds rl.Rectangle, text *string, textSize int, editMode bool) boo
} }
ctext := (*C.char)(unsafe.Pointer(&bs[0])) ctext := (*C.char)(unsafe.Pointer(&bs[0]))
defer func() { defer func() {
*text = strings.TrimSpace(strings.Trim(string(bs), "\x00")) *text = strings.Trim(string(bs), "\x00")
// no need : C.free(unsafe.Pointer(ctext)) // no need : C.free(unsafe.Pointer(ctext))
}() }()