From cadea444a0071f2fc92d1a98eed40766dbfbc473 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 24 May 2004 19:52:41 +0000 Subject: [PATCH] Fix FullPaint to actually force the whole window to be repainted instead of being constrained by the previous paint's update region. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/ScintillaWX.cpp | 23 ++++++----------------- src/stc/ScintillaWX.cpp | 23 ++++++----------------- 2 files changed, 12 insertions(+), 34 deletions(-) diff --git a/contrib/src/stc/ScintillaWX.cpp b/contrib/src/stc/ScintillaWX.cpp index 9b9addb843..62ac066fb9 100644 --- a/contrib/src/stc/ScintillaWX.cpp +++ b/contrib/src/stc/ScintillaWX.cpp @@ -542,14 +542,15 @@ void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) { dc->BeginDrawing(); ClipChildren(*dc, rcPaint); Paint(surfaceWindow, rcPaint); - dc->EndDrawing(); delete surfaceWindow; if (paintState == paintAbandoned) { - // Painting area was insufficient to cover new styling or brace highlight positions + // Painting area was insufficient to cover new styling or brace + // highlight positions FullPaint(dc); } paintState = notPainting; + dc->EndDrawing(); } @@ -860,22 +861,10 @@ void ScintillaWX::DoDragLeave() { #endif //---------------------------------------------------------------------- -// Redraw all of text area. This paint will not be abandoned. +// Force the whole window to be repainted void ScintillaWX::FullPaint(wxDC *dc) { - wxCHECK_RET(dc != NULL, wxT("Invalid wxDC in ScintillaWX::FillPaint")); - paintState = painting; - rcPaint = GetClientRectangle(); - paintingAllText = true; - Surface* surfaceWindow = Surface::Allocate(); - surfaceWindow->Init(dc, wMain.GetID()); - - dc->BeginDrawing(); - ClipChildren(*dc, rcPaint); - Paint(surfaceWindow, rcPaint); - dc->EndDrawing(); - - delete surfaceWindow; - paintState = notPainting; + stc->Refresh(false); + stc->Update(); } diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index 9b9addb843..62ac066fb9 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -542,14 +542,15 @@ void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) { dc->BeginDrawing(); ClipChildren(*dc, rcPaint); Paint(surfaceWindow, rcPaint); - dc->EndDrawing(); delete surfaceWindow; if (paintState == paintAbandoned) { - // Painting area was insufficient to cover new styling or brace highlight positions + // Painting area was insufficient to cover new styling or brace + // highlight positions FullPaint(dc); } paintState = notPainting; + dc->EndDrawing(); } @@ -860,22 +861,10 @@ void ScintillaWX::DoDragLeave() { #endif //---------------------------------------------------------------------- -// Redraw all of text area. This paint will not be abandoned. +// Force the whole window to be repainted void ScintillaWX::FullPaint(wxDC *dc) { - wxCHECK_RET(dc != NULL, wxT("Invalid wxDC in ScintillaWX::FillPaint")); - paintState = painting; - rcPaint = GetClientRectangle(); - paintingAllText = true; - Surface* surfaceWindow = Surface::Allocate(); - surfaceWindow->Init(dc, wMain.GetID()); - - dc->BeginDrawing(); - ClipChildren(*dc, rcPaint); - Paint(surfaceWindow, rcPaint); - dc->EndDrawing(); - - delete surfaceWindow; - paintState = notPainting; + stc->Refresh(false); + stc->Update(); } -- 2.45.2