Implemented Clear in wxSVGFileDC.

Draw a rectangle with the background colour and a transparent pen.
Closes #15788.
This commit is contained in:
Maarten Bent
2016-03-15 22:12:13 +01:00
parent b424445078
commit 3cc4d51c9b
3 changed files with 13 additions and 5 deletions

View File

@@ -81,10 +81,7 @@ public:
return -1; return -1;
} }
virtual void Clear() wxOVERRIDE virtual void Clear() wxOVERRIDE;
{
wxFAIL_MSG(wxT("wxSVGFILEDC::Clear() Call not implemented \nNot sensible for an output file?"));
}
virtual void DestroyClippingRegion() wxOVERRIDE; virtual void DestroyClippingRegion() wxOVERRIDE;

View File

@@ -60,7 +60,7 @@ public:
void EndPage(); void EndPage();
/** /**
This makes no sense in wxSVGFileDC and does nothing. Draws a rectangle the size of the SVG using the wxDC::SetBackground() brush.
*/ */
void Clear(); void Clear();

View File

@@ -305,6 +305,17 @@ wxSize wxSVGFileDCImpl::GetPPI() const
return wxSize( wxRound(m_dpi), wxRound(m_dpi) ); return wxSize( wxRound(m_dpi), wxRound(m_dpi) );
} }
void wxSVGFileDCImpl::Clear()
{
{
wxDCBrushChanger setBackground(*GetOwner(), m_backgroundBrush);
wxDCPenChanger setTransp(*GetOwner(), *wxTRANSPARENT_PEN);
DoDrawRectangle(0, 0, m_width, m_height);
}
NewGraphicsIfNeeded();
}
void wxSVGFileDCImpl::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) void wxSVGFileDCImpl::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{ {
NewGraphicsIfNeeded(); NewGraphicsIfNeeded();