|
@@ -156,13 +156,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*, ImGuiPlatformImeData* data)
|
|
|
+static void ImGui_ImplSDL2_SetPlatformImeData(ImGuiViewport* viewport, ImGuiPlatformImeData* data)
|
|
|
{
|
|
|
if (data->WantVisible)
|
|
|
{
|
|
|
SDL_Rect r;
|
|
|
- r.x = (int)data->InputPos.x;
|
|
|
- r.y = (int)data->InputPos.y;
|
|
|
+ r.x = (int)(data->InputPos.x - viewport->Pos.x);
|
|
|
+ r.y = (int)(data->InputPos.y - viewport->Pos.y + data->InputLineHeight);
|
|
|
r.w = 1;
|
|
|
r.h = (int)data->InputLineHeight;
|
|
|
SDL_SetTextInputRect(&r);
|