Skip to content

Commit

Permalink
Fix change from upstream imgui
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkewley committed Aug 2, 2024
1 parent d4dc901 commit f4558a2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/oscar/UI/imgui_impl_sdl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ static void ImGui_ImplSDL2_SetClipboardText(void*, const char* text)
}

// Note: native IME will only display if user calls SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1") _before_ SDL_CreateWindow().
static void ImGui_ImplSDL2_SetPlatformImeData(ImGuiViewport* viewport, ImGuiPlatformImeData* data)
static void ImGui_ImplSDL2_PlatformSetImeData(ImGuiContext*, ImGuiViewport*, ImGuiPlatformImeData* data)
{
if (data->WantVisible)
{
SDL_Rect r;
r.x = (int)(data->InputPos.x - viewport->Pos.x);
r.y = (int)(data->InputPos.y - viewport->Pos.y + data->InputLineHeight);
r.x = (int)data->InputPos.x;
r.y = (int)data->InputPos.y;
r.w = 1;
r.h = (int)data->InputLineHeight;
SDL_SetTextInputRect(&r);
Expand Down Expand Up @@ -487,7 +487,10 @@ static bool ImGui_ImplSDL2_Init(SDL_Window* window, SDL_Renderer* renderer, void
io.SetClipboardTextFn = ImGui_ImplSDL2_SetClipboardText;
io.GetClipboardTextFn = ImGui_ImplSDL2_GetClipboardText;
io.ClipboardUserData = nullptr;
io.SetPlatformImeDataFn = ImGui_ImplSDL2_SetPlatformImeData;
io.PlatformSetImeDataFn = ImGui_ImplSDL2_PlatformSetImeData;
#ifdef __EMSCRIPTEN__
io.PlatformOpenInShellFn = [](ImGuiContext*, const char* url) { ImGui_ImplSDL2_EmscriptenOpenURL(url); return true; };
#endif

// Gamepad handling
bd->GamepadMode = ImGui_ImplSDL2_GamepadMode_AutoFirst;
Expand Down

0 comments on commit f4558a2

Please sign in to comment.