From 0b4f8b1cc09fd86efd233c62a5992c91f759f837 Mon Sep 17 00:00:00 2001 From: John Bannister Date: Sun, 7 Apr 2024 14:12:03 +0100 Subject: [PATCH] Fix ScrollPanel view binding The values on the view parameter of ScrollPanel() should be updated with the values set by the C method. --- raygui/raygui.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/raygui/raygui.go b/raygui/raygui.go index 1a3f8ef..2e7a6ed 100644 --- a/raygui/raygui.go +++ b/raygui/raygui.go @@ -375,6 +375,12 @@ func ScrollPanel(bounds rl.Rectangle, text string, content rl.Rectangle, scroll cview.y = C.float(view.Y) cview.width = C.float(view.Width) 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)