aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--win32/ScintillaWin.cxx39
1 files changed, 18 insertions, 21 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index 76e11e7b7..35f2044fc 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -548,22 +548,22 @@ LRESULT ScintillaWin::WndPaint(uptr_t wParam) {
// Redirect assertions to debug output and save current state
bool assertsPopup = Platform::ShowAssertionPopUps(false);
paintState = painting;
+ PAINTSTRUCT ps;
+ PAINTSTRUCT *pps;
+
+ bool IsOcxCtrl = (wParam != 0); // if wParam != 0, it contains
+ // a PAINSTRUCT* from the OCX
+ // Removed since this interferes with reporting other assertions as it occurs repeatedly
+ //PLATFORM_ASSERT(hRgnUpdate == NULL);
+ hRgnUpdate = ::CreateRectRgn(0, 0, 0, 0);
+ if (IsOcxCtrl) {
+ pps = reinterpret_cast<PAINTSTRUCT*>(wParam);
+ } else {
+ ::GetUpdateRgn(MainHWND(), hRgnUpdate, FALSE);
+ pps = &ps;
+ ::BeginPaint(MainHWND(), pps);
+ }
if (technology == SC_TECHNOLOGY_DEFAULT) {
- PAINTSTRUCT ps;
- PAINTSTRUCT *pps;
-
- bool IsOcxCtrl = (wParam != 0); // if wParam != 0, it contains
- // a PAINSTRUCT* from the OCX
- // Removed since this interferes with reporting other assertions as it occurs repeatedly
- //PLATFORM_ASSERT(hRgnUpdate == NULL);
- hRgnUpdate = ::CreateRectRgn(0, 0, 0, 0);
- if (IsOcxCtrl) {
- pps = reinterpret_cast<PAINTSTRUCT*>(wParam);
- } else {
- ::GetUpdateRgn(MainHWND(), hRgnUpdate, FALSE);
- pps = &ps;
- ::BeginPaint(MainHWND(), pps);
- }
AutoSurface surfaceWindow(pps->hdc, this);
if (surfaceWindow) {
rcPaint = PRectangle(pps->rcPaint.left, pps->rcPaint.top, pps->rcPaint.right, pps->rcPaint.bottom);
@@ -572,18 +572,13 @@ LRESULT ScintillaWin::WndPaint(uptr_t wParam) {
Paint(surfaceWindow, rcPaint);
surfaceWindow->Release();
}
- if (!IsOcxCtrl)
- ::EndPaint(MainHWND(), pps);
} else {
#if defined(USE_D2D)
EnsureRenderTarget();
AutoSurface surfaceWindow(pRenderTarget, this);
if (surfaceWindow) {
pRenderTarget->BeginDraw();
- RECT rcUpdate;
- ::GetUpdateRect(MainHWND(), &rcUpdate, FALSE);
- rcPaint = PRectangle(rcUpdate.left, rcUpdate.top, rcUpdate.right, rcUpdate.bottom);
- //rcPaint = GetClientRectangle();
+ rcPaint = PRectangle(pps->rcPaint.left, pps->rcPaint.top, pps->rcPaint.right, pps->rcPaint.bottom);
PRectangle rcClient = GetClientRectangle();
paintingAllText = rcPaint.Contains(rcClient);
if (paintingAllText) {
@@ -605,6 +600,8 @@ LRESULT ScintillaWin::WndPaint(uptr_t wParam) {
hRgnUpdate = 0;
}
+ if (!IsOcxCtrl)
+ ::EndPaint(MainHWND(), pps);
if (paintState == paintAbandoned) {
// Painting area was insufficient to cover new styling or brace highlight positions
FullPaint();