From 162aa0cad54f2e6b26cb7f5b8e78c3db0874c0a9 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 3 Aug 2004 01:37:22 +0000 Subject: Patch from Kein-Hong Man to ensure system caret bitmap is empty. --- win32/ScintillaWin.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index be21fa4d5..647ae982e 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -2138,7 +2138,13 @@ BOOL ScintillaWin::CreateSystemCaret() { sysCaretWidth = 1; } sysCaretHeight = vs.lineHeight; - sysCaretBitmap = ::CreateBitmap(sysCaretWidth, sysCaretHeight, 1, 1, NULL); + int bitmapSize = (((sysCaretWidth + 15) & ~15) >> 3) * + sysCaretHeight; + char *bits = new char[bitmapSize]; + memset(bits, 0, bitmapSize); + sysCaretBitmap = ::CreateBitmap(sysCaretWidth, sysCaretHeight, 1, + 1, reinterpret_cast(bits)); + delete []bits; BOOL retval = ::CreateCaret( MainHWND(), sysCaretBitmap, sysCaretWidth, sysCaretHeight); -- cgit v1.2.3