Skip to content

Commit

Permalink
Platform IME: add ImGuiPlatformImeData::InputLineHeight (unused by wi…
Browse files Browse the repository at this point in the history
…n32). (#3113)
  • Loading branch information
liuliu authored and ocornut committed Jan 5, 2022
1 parent 29a8ee0 commit de36ff0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Other Changes:
now taking a ImGuiPlatformImeData structure which we can more easily extend in the future.
- Platform IME: moved io.ImeWindowHandle to GetMainViewport()->PlatformHandleRaw.
- Platform IME: add ImGuiPlatformImeData::WantVisible, hide IME composition window when not used. (#2589) [@actboy168]
- Platform IME: add ImGuiPlatformImeData::InputLineHeight. (#3113) [@liuliu]
- Platform IME: [windows] call ImmSetCandidateWindow() to position candidate window.
- Backends: OpenGL3: Fixed a buffer overflow in imgui_impl_opengl3_loader.h init (added in 1.86). (#4468, #4830) [@dymk]
It would generally not have noticeable side-effect at runtime but would be detected by runtime checkers.
Expand Down
1 change: 1 addition & 0 deletions imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -2834,6 +2834,7 @@ struct ImGuiPlatformImeData
{
bool WantVisible; // A widget wants the IME to be visible
ImVec2 InputPos; // Position of the input cursor
float InputLineHeight; // Line height

ImGuiPlatformImeData() { memset(this, 0, sizeof(*this)); }
};
Expand Down
1 change: 1 addition & 0 deletions imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4763,6 +4763,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
{
g.PlatformImeData.WantVisible = true;
g.PlatformImeData.InputPos = ImVec2(cursor_screen_pos.x - 1.0f, cursor_screen_pos.y - g.FontSize);
g.PlatformImeData.InputLineHeight = g.FontSize;
}
}
}
Expand Down

0 comments on commit de36ff0

Please sign in to comment.