aboutsummaryrefslogtreecommitdiffhomepage
path: root/cocoa/ScintillaCocoa.mm
diff options
context:
space:
mode:
authornyamatongwe <nyamatongwe@gmail.com>2012-08-24 18:56:54 +1000
committernyamatongwe <nyamatongwe@gmail.com>2012-08-24 18:56:54 +1000
commitc4ce4d309ac593373d533e9913b0a6a5f4400e0b (patch)
treed2167d2826706319fdc379029127905b4dfe3c15 /cocoa/ScintillaCocoa.mm
parent48eb4e8d252086bfd55d3a16eb2bc8d374525299 (diff)
downloadscintilla-mirror-c4ce4d309ac593373d533e9913b0a6a5f4400e0b.tar.gz
Ensure abandoned paints cover full area by using NSView display instead of trying
to draw more within initial drawing context.
Diffstat (limited to 'cocoa/ScintillaCocoa.mm')
-rw-r--r--cocoa/ScintillaCocoa.mm17
1 files changed, 6 insertions, 11 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm
index 7fc07c7c1..a19b62216 100644
--- a/cocoa/ScintillaCocoa.mm
+++ b/cocoa/ScintillaCocoa.mm
@@ -1439,29 +1439,24 @@ bool ScintillaCocoa::HaveMouseCapture()
/**
* Synchronously paint a rectangle of the window.
*/
-void ScintillaCocoa::SyncPaint(void* gc, PRectangle rc)
+bool ScintillaCocoa::SyncPaint(void* gc, PRectangle rc)
{
paintState = painting;
rcPaint = rc;
PRectangle rcText = GetTextRectangle();
paintingAllText = rcPaint.Contains(rcText);
+ bool succeeded = true;
Surface *sw = Surface::Allocate(SC_TECHNOLOGY_DEFAULT);
if (sw)
{
sw->Init(gc, wMain.GetID());
Paint(sw, rc);
- if (paintState == paintAbandoned)
- {
- // Do a full paint.
- rcPaint = GetClientRectangle();
- paintState = painting;
- paintingAllText = true;
- Paint(sw, rcPaint);
- }
+ succeeded = paintState != paintAbandoned;
sw->Release();
delete sw;
}
paintState = notPainting;
+ return succeeded;
}
//--------------------------------------------------------------------------------------------------
@@ -1769,9 +1764,9 @@ void ScintillaCocoa::IdleTimerFired()
* @param rect The area to paint, given in the sender's coordinate system.
* @param gc The context we can use to paint.
*/
-void ScintillaCocoa::Draw(NSRect rect, CGContextRef gc)
+bool ScintillaCocoa::Draw(NSRect rect, CGContextRef gc)
{
- SyncPaint(gc, NSRectToPRectangle(rect));
+ return SyncPaint(gc, NSRectToPRectangle(rect));
}
//--------------------------------------------------------------------------------------------------