[feat] add space automaticlly for remote id input box

This commit is contained in:
dijunkun
2024-08-09 11:33:13 +08:00
parent 0ea8916426
commit 03ea96096d

View File

@@ -5,9 +5,14 @@
#include "render.h" #include "render.h"
static int InputTextCallback(ImGuiInputTextCallbackData *data) { static int InputTextCallback(ImGuiInputTextCallbackData *data) {
if (data->CursorPos == 3 || data->CursorPos == 7) { if (data->BufTextLen > 3 && data->Buf[3] != ' ') {
data->InsertChars(data->CursorPos, " "); data->InsertChars(3, " ");
} }
if (data->BufTextLen > 7 && data->Buf[7] != ' ') {
data->InsertChars(7, " ");
}
return 0; return 0;
} }