From c4db23f76c9814fbdba304f4ad3fcc7ddd4f30ec Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Wed, 17 Jul 2019 15:32:16 +1000 Subject: Feature [feature-requests:#1300] part 2. Position candidate window closer to composition text. --- doc/ScintillaHistory.html | 1 + win32/ScintillaWin.cxx | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index bde4d4408..18d6dfe01 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -569,6 +569,7 @@
  • On Win32, stop the IME candidate window moving unnecessarily and position it better.
    Stop candidate window overlapping composition text and taskbar.
    + Position candidate window closer to composition text.
    Bug #2120. Feature #1300.
  • diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 459d926b1..55606fe07 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -23,6 +23,10 @@ #include #include +// Want to use std::min and std::max so don't want Windows.h version of min and max +#if !defined(NOMINMAX) +#define NOMINMAX +#endif #undef _WIN32_WINNT #define _WIN32_WINNT 0x0500 #undef WINVER @@ -945,7 +949,7 @@ void ScintillaWin::SetCandidateWindowPos() { CandForm.dwIndex = 0; CandForm.dwStyle = CFS_EXCLUDE; CandForm.ptCurrentPos.x = static_cast(pos.x); - CandForm.ptCurrentPos.y = static_cast(pos.y + vs.lineHeight); + CandForm.ptCurrentPos.y = static_cast(pos.y + std::max(4, vs.lineHeight/4)); // Exclude the area of the whole caret line CandForm.rcArea.top = static_cast(pos.y); CandForm.rcArea.bottom = static_cast(pos.y + vs.lineHeight); -- cgit v1.2.3