aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32
diff options
context:
space:
mode:
authorZufu Liu <unknown>2019-07-17 15:32:16 +1000
committerZufu Liu <unknown>2019-07-17 15:32:16 +1000
commitc4db23f76c9814fbdba304f4ad3fcc7ddd4f30ec (patch)
treec225913f2491bc4e329cbf5274b494cf241001ce /win32
parent071af976dafcf59d64de91989607ba1fb58592c9 (diff)
downloadscintilla-mirror-c4db23f76c9814fbdba304f4ad3fcc7ddd4f30ec.tar.gz
Feature [feature-requests:#1300] part 2. Position candidate window closer to
composition text.
Diffstat (limited to 'win32')
-rw-r--r--win32/ScintillaWin.cxx6
1 files changed, 5 insertions, 1 deletions
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 <memory>
#include <chrono>
+// 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<int>(pos.x);
- CandForm.ptCurrentPos.y = static_cast<int>(pos.y + vs.lineHeight);
+ CandForm.ptCurrentPos.y = static_cast<int>(pos.y + std::max(4, vs.lineHeight/4));
// Exclude the area of the whole caret line
CandForm.rcArea.top = static_cast<int>(pos.y);
CandForm.rcArea.bottom = static_cast<int>(pos.y + vs.lineHeight);