Added wxMemoryDC::Clear()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31302 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
#import <AppKit/NSImage.h>
|
||||
#import <AppKit/NSAffineTransform.h>
|
||||
#import <AppKit/NSGraphicsContext.h>
|
||||
#import <AppKit/NSColor.h>
|
||||
#import <AppKit/NSBezierPath.h>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxMemoryDC
|
||||
@@ -150,3 +152,20 @@ bool wxMemoryDC::CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest,
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxMemoryDC::Clear()
|
||||
{
|
||||
if(!CocoaTakeFocus()) return;
|
||||
|
||||
NSGraphicsContext *context = [NSGraphicsContext currentContext];
|
||||
[context saveGraphicsState];
|
||||
|
||||
[m_backgroundBrush.GetNSColor() set];
|
||||
NSRect rect;
|
||||
rect.origin.x = 0;
|
||||
rect.origin.y = 0;
|
||||
rect.size = [m_cocoaNSImage size];
|
||||
[NSBezierPath fillRect:rect];
|
||||
|
||||
[context restoreGraphicsState];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user