Skip to content

Commit

Permalink
WIN32: Better support for IME
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed Jul 1, 2024
1 parent 9b68e5d commit f507b9b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/lib/extern/glfw
4 changes: 4 additions & 0 deletions library/lib/platforms/glfw/glfw_ime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ void GLFWImeManager::openInputDialog(std::function<void(std::string)> cb, std::s
dialog->setHintText(subText);
dialog->setHeaderText(headerText);
dialog->setCountText(std::to_string(utf8len(initialText.data())) + "/" + std::to_string(maxStringLength));
#if defined(BOREALIS_USE_D3D11)
float scale = Application::windowScale;
#else
float scale = Application::windowScale / Application::getPlatform()->getVideoContext()->getScaleFactor();
#endif
dialog->getLayoutEvent()->subscribe([this, scale](Point p)
{ glfwSetPreeditCursorRectangle(window, p.x * scale, p.y * scale, 1, 1); });

Expand Down
4 changes: 4 additions & 0 deletions library/lib/platforms/sdl/sdl_ime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ namespace brls
cursor = -1;
updateText();
if(!initialText.empty()) updateTextCursor();
#if defined(BOREALIS_USE_D3D11)
float scale = Application::windowScale;
#else
float scale = Application::windowScale / Application::getPlatform()->getVideoContext()->getScaleFactor();
#endif
// 更新输入法条位置
dialog->getLayoutEvent()->subscribe([scale](Point p) {
#ifndef PS4
Expand Down

0 comments on commit f507b9b

Please sign in to comment.