Enable usage of clipping regions in wxSVGFileDC.
It was implemented 3 and half years ago in 614e38d
.
Close remaining clipping regions when closing the SVG file.
This commit is contained in:
@@ -91,10 +91,10 @@ public:
|
||||
virtual wxCoord GetCharHeight() const wxOVERRIDE;
|
||||
virtual wxCoord GetCharWidth() const wxOVERRIDE;
|
||||
|
||||
virtual void SetClippingRegion(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
|
||||
wxCoord WXUNUSED(w), wxCoord WXUNUSED(h))
|
||||
virtual void SetClippingRegion(wxCoord x, wxCoord y,
|
||||
wxCoord w, wxCoord h)
|
||||
{
|
||||
wxFAIL_MSG(wxT("wxSVGFILEDC::SetClippingRegion not implemented"));
|
||||
DoSetClippingRegion(x, y, w, h);
|
||||
}
|
||||
|
||||
virtual void SetPalette(const wxPalette& WXUNUSED(palette)) wxOVERRIDE
|
||||
@@ -102,10 +102,10 @@ public:
|
||||
wxFAIL_MSG(wxT("wxSVGFILEDC::SetPalette not implemented"));
|
||||
}
|
||||
|
||||
virtual void GetClippingBox(wxCoord *WXUNUSED(x), wxCoord *WXUNUSED(y),
|
||||
wxCoord *WXUNUSED(w), wxCoord *WXUNUSED(h))
|
||||
virtual void GetClippingBox(wxCoord *x, wxCoord *y,
|
||||
wxCoord *w, wxCoord *h)
|
||||
{
|
||||
wxFAIL_MSG(wxT("wxSVGFILEDC::GetClippingBox not implemented"));
|
||||
DoGetClippingBox(x, y, w, h);
|
||||
}
|
||||
|
||||
virtual void SetLogicalFunction(wxRasterOperationMode WXUNUSED(function)) wxOVERRIDE
|
||||
@@ -201,9 +201,10 @@ private:
|
||||
wxCoord *externalLeading = NULL,
|
||||
const wxFont *font = NULL) const wxOVERRIDE;
|
||||
|
||||
virtual void DoSetDeviceClippingRegion(const wxRegion& WXUNUSED(region)) wxOVERRIDE
|
||||
virtual void DoSetDeviceClippingRegion(const wxRegion& region) wxOVERRIDE
|
||||
{
|
||||
wxFAIL_MSG(wxT("wxSVGFILEDC::DoSetDeviceClippingRegion not yet implemented"));
|
||||
DoSetClippingRegion(region.GetBox().x, region.GetBox().y,
|
||||
region.GetBox().width, region.GetBox().height);
|
||||
}
|
||||
|
||||
virtual void DoSetClippingRegion(int x, int y, int width, int height) wxOVERRIDE;
|
||||
|
@@ -279,7 +279,13 @@ void wxSVGFileDCImpl::Init (const wxString &filename, int Width, int Height, dou
|
||||
|
||||
wxSVGFileDCImpl::~wxSVGFileDCImpl()
|
||||
{
|
||||
wxString s = wxT("</g> \n</svg> \n");
|
||||
wxString s;
|
||||
|
||||
// Close remaining clipping group elements
|
||||
for (size_t i = 0; i < m_clipUniqueId; i++)
|
||||
s += wxS("</g>\n");
|
||||
|
||||
s += wxS("</g>\n</svg>\n");
|
||||
write(s);
|
||||
delete m_outfile;
|
||||
}
|
||||
@@ -656,9 +662,8 @@ void wxSVGFileDCImpl::DestroyClippingRegion()
|
||||
// Close clipping group elements
|
||||
for ( size_t i = 0; i < m_clipUniqueId; i++ )
|
||||
{
|
||||
svg << "</g>";
|
||||
svg << "</g>\n";
|
||||
}
|
||||
svg << "\n";
|
||||
|
||||
write(svg);
|
||||
|
||||
|
Reference in New Issue
Block a user