diff options
-rw-r--r-- | scintilla/src/Document.cxx | 2 | ||||
-rw-r--r-- | scintilla/win32/ScintillaWin.cxx | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/scintilla/src/Document.cxx b/scintilla/src/Document.cxx index e523787..5a1514a 100644 --- a/scintilla/src/Document.cxx +++ b/scintilla/src/Document.cxx @@ -1461,7 +1461,7 @@ long Document::FindText(int minPos, int maxPos, const char *search, const int endPos = MovePositionOutsideChar(maxPos, increment, false);
// Compute actual search ranges needed
- const int lengthFind = (*length == -1) ? static_cast<int>(strlen(search)) : *length;
+ const int lengthFind = *length;
//Platform::DebugPrintf("Find %d %d %s %d\n", startPos, endPos, ft->lpstrText, lengthFind);
const int limitPos = Platform::Maximum(startPos, endPos);
diff --git a/scintilla/win32/ScintillaWin.cxx b/scintilla/win32/ScintillaWin.cxx index 0a7bba7..e012258 100644 --- a/scintilla/win32/ScintillaWin.cxx +++ b/scintilla/win32/ScintillaWin.cxx @@ -210,6 +210,7 @@ class ScintillaWin : #if defined(USE_D2D)
ID2D1HwndRenderTarget *pRenderTarget;
+ bool renderTargetValid;
#endif
ScintillaWin(HWND hwnd);
@@ -368,6 +369,7 @@ ScintillaWin::ScintillaWin(HWND hwnd) { #if defined(USE_D2D)
pRenderTarget = 0;
+ renderTargetValid = true;
#endif
keysAlwaysUnicode = false;
@@ -413,6 +415,10 @@ void ScintillaWin::Finalise() { void ScintillaWin::EnsureRenderTarget() {
#if defined(USE_D2D)
+ if (!renderTargetValid) {
+ DropRenderTarget();
+ renderTargetValid = true;
+ }
if (pD2DFactory && !pRenderTarget) {
RECT rc;
HWND hw = MainHWND();
@@ -751,7 +757,13 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam break;
case WM_SIZE: {
- DropRenderTarget();
+#if defined(USE_D2D)
+ if (paintState == notPainting) {
+ DropRenderTarget();
+ } else {
+ renderTargetValid = false;
+ }
+#endif
//Platform::DebugPrintf("Scintilla WM_SIZE %d %d\n", LoWord(lParam), HiWord(lParam));
ChangeSize();
}
|