Fix ScrollPanel view binding

The values on the view parameter of ScrollPanel() should be updated with
the values set by the C method.
This commit is contained in:
John Bannister 2024-04-07 14:12:03 +01:00
parent c3665eb9ab
commit 0b4f8b1cc0

View file

@ -375,6 +375,12 @@ func ScrollPanel(bounds rl.Rectangle, text string, content rl.Rectangle, scroll
cview.y = C.float(view.Y) cview.y = C.float(view.Y)
cview.width = C.float(view.Width) cview.width = C.float(view.Width)
cview.height = C.float(view.Height) cview.height = C.float(view.Height)
defer func() {
view.X = float32(cview.x)
view.Y = float32(cview.y)
view.Width = float32(cview.width)
view.Height = float32(cview.height)
}()
res := C.GuiScrollPanel(cbounds, ctext, ccontent, &cscroll, &cview) res := C.GuiScrollPanel(cbounds, ctext, ccontent, &cscroll, &cview)