+void wxSVGFileDCImpl::DoSetClippingRegion( int x, int y, int width, int height )
+{
+ wxString svg;
+
+ // End current graphics group to ensure proper xml nesting (e.g. so that
+ // graphics can be subsequently changed inside the clipping region)
+ svg << "</g>\n"
+ "<defs>\n"
+ "<clipPath id=\"clip" << m_clipNestingLevel << "\">\n"
+ "<rect id=\"cliprect" << m_clipNestingLevel << "\" "
+ "x=\"" << x << "\" "
+ "y=\"" << y << "\" "
+ "width=\"" << width << "\" "
+ "height=\"" << height << "\" "
+ "style=\"stroke: gray; fill: none;\"/>\n"
+ "</clipPath>\n"
+ "</defs>\n"
+ "<g style=\"clip-path: url(#clip" << m_clipNestingLevel << ");\">\n";
+
+ write(svg);
+
+ // Re-apply current graphics to ensure proper xml nesting
+ DoStartNewGraphics();
+
+ m_clipUniqueId++;
+ m_clipNestingLevel++;