diff --git a/lib/preludes/raygui-prelude.zig b/lib/preludes/raygui-prelude.zig index 15fca97..9705349 100644 --- a/lib/preludes/raygui-prelude.zig +++ b/lib/preludes/raygui-prelude.zig @@ -520,5 +520,5 @@ pub fn checkBox(bounds: Rectangle, text: [:0]const u8, checked: *bool) bool { /// Text Box control, updates input text /// Returns true on ENTER pressed (useful for data validation) pub fn textBox(bounds: Rectangle, text: [:0]u8, editMode: bool) bool { - return @as(i32, cdef.GuiTextBox(bounds, @as([*c]u8, @ptrCast(text)), @as(c_int, @intCast(text.len)), editMode)) > 0; + return @as(i32, cdef.GuiTextBox(bounds, @as([*c]u8, @ptrCast(text)), @as(c_int, @intCast(text.len)) + 1, editMode)) > 0; } diff --git a/lib/raygui.zig b/lib/raygui.zig index 26e230e..3803c16 100644 --- a/lib/raygui.zig +++ b/lib/raygui.zig @@ -520,7 +520,7 @@ pub fn checkBox(bounds: Rectangle, text: [:0]const u8, checked: *bool) bool { /// Text Box control, updates input text /// Returns true on ENTER pressed (useful for data validation) pub fn textBox(bounds: Rectangle, text: [:0]u8, editMode: bool) bool { - return @as(i32, cdef.GuiTextBox(bounds, @as([*c]u8, @ptrCast(text)), @as(c_int, @intCast(text.len)), editMode)) > 0; + return @as(i32, cdef.GuiTextBox(bounds, @as([*c]u8, @ptrCast(text)), @as(c_int, @intCast(text.len)) + 1, editMode)) > 0; } /// Enable gui controls (global state)