Implement wxBRUSHSTYLE_BDIAGONAL_HATCH for wxSVGFileDC
Create new graphics group before writing brush pattern, so pattern appears in the same group as the elements using it.
This commit is contained in:
@@ -110,6 +110,7 @@ wxString wxFillString(wxColour c, int style = wxBRUSHSTYLE_SOLID)
|
|||||||
switch ( style )
|
switch ( style )
|
||||||
{
|
{
|
||||||
case wxBRUSHSTYLE_SOLID:
|
case wxBRUSHSTYLE_SOLID:
|
||||||
|
case wxBRUSHSTYLE_BDIAGONAL_HATCH:
|
||||||
case wxBRUSHSTYLE_FDIAGONAL_HATCH:
|
case wxBRUSHSTYLE_FDIAGONAL_HATCH:
|
||||||
case wxBRUSHSTYLE_CROSSDIAG_HATCH:
|
case wxBRUSHSTYLE_CROSSDIAG_HATCH:
|
||||||
case wxBRUSHSTYLE_CROSS_HATCH:
|
case wxBRUSHSTYLE_CROSS_HATCH:
|
||||||
@@ -236,6 +237,9 @@ wxString wxGetBrushStyleName(wxBrush const& brush)
|
|||||||
|
|
||||||
switch (brush.GetStyle())
|
switch (brush.GetStyle())
|
||||||
{
|
{
|
||||||
|
case wxBRUSHSTYLE_BDIAGONAL_HATCH:
|
||||||
|
brushStyle = wxS("BdiagonalHatch");
|
||||||
|
break;
|
||||||
case wxBRUSHSTYLE_FDIAGONAL_HATCH:
|
case wxBRUSHSTYLE_FDIAGONAL_HATCH:
|
||||||
brushStyle = wxS("FdiagonalHatch");
|
brushStyle = wxS("FdiagonalHatch");
|
||||||
break;
|
break;
|
||||||
@@ -254,7 +258,6 @@ wxString wxGetBrushStyleName(wxBrush const& brush)
|
|||||||
case wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE:
|
case wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE:
|
||||||
case wxBRUSHSTYLE_STIPPLE_MASK:
|
case wxBRUSHSTYLE_STIPPLE_MASK:
|
||||||
case wxBRUSHSTYLE_STIPPLE:
|
case wxBRUSHSTYLE_STIPPLE:
|
||||||
case wxBRUSHSTYLE_BDIAGONAL_HATCH:
|
|
||||||
wxASSERT_MSG(false, wxS("wxSVGFileDC::Requested Brush Fill not available"));
|
wxASSERT_MSG(false, wxS("wxSVGFileDC::Requested Brush Fill not available"));
|
||||||
break;
|
break;
|
||||||
case wxBRUSHSTYLE_SOLID:
|
case wxBRUSHSTYLE_SOLID:
|
||||||
@@ -288,6 +291,9 @@ wxString wxCreateBrushFill(wxBrush& brush)
|
|||||||
wxString pattern;
|
wxString pattern;
|
||||||
switch (brush.GetStyle())
|
switch (brush.GetStyle())
|
||||||
{
|
{
|
||||||
|
case wxBRUSHSTYLE_BDIAGONAL_HATCH:
|
||||||
|
pattern = wxS("d=\"M-1,1 l2,-2 M0,8 l8,-8 M7,9 l2,-2\"");
|
||||||
|
break;
|
||||||
case wxBRUSHSTYLE_FDIAGONAL_HATCH:
|
case wxBRUSHSTYLE_FDIAGONAL_HATCH:
|
||||||
pattern = wxS("d=\"M7,-1 l2,2 M0,0 l8,8 M-1,7 l2,2\"");
|
pattern = wxS("d=\"M7,-1 l2,2 M0,0 l8,8 M-1,7 l2,2\"");
|
||||||
break;
|
break;
|
||||||
@@ -1079,8 +1085,13 @@ void wxSVGFileDCImpl::SetBrush(const wxBrush& brush)
|
|||||||
m_graphics_changed = true;
|
m_graphics_changed = true;
|
||||||
|
|
||||||
wxString pattern = wxCreateBrushFill(m_brush);
|
wxString pattern = wxCreateBrushFill(m_brush);
|
||||||
|
if ( !pattern.IsEmpty() )
|
||||||
|
{
|
||||||
|
NewGraphicsIfNeeded();
|
||||||
|
|
||||||
write(pattern);
|
write(pattern);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void wxSVGFileDCImpl::SetPen(const wxPen& pen)
|
void wxSVGFileDCImpl::SetPen(const wxPen& pen)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user