CalcBoundingBox( x, y );
}
-void wxPostScriptDCImpl::DoDrawPolygon (int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle)
+void wxPostScriptDCImpl::DoDrawPolygon (int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle)
{
wxCHECK_RET( m_ok, wxT("invalid postscript dc") );
}
}
-void wxPostScriptDCImpl::DoDrawPolyPolygon (int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle)
+void wxPostScriptDCImpl::DoDrawPolyPolygon (int n, const int count[], const wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle)
{
wxCHECK_RET( m_ok, wxT("invalid postscript dc") );
}
}
-void wxPostScriptDCImpl::DoDrawLines (int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
+void wxPostScriptDCImpl::DoDrawLines (int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset)
{
wxCHECK_RET( m_ok, wxT("invalid postscript dc") );
if (!pen.IsOk()) return;
- int oldStyle = m_pen.GetStyle();
+ int oldStyle = m_pen.IsOk() ? m_pen.GetStyle() : wxPENSTYLE_INVALID;
+ wxPenCap oldCap = m_pen.IsOk() ? m_pen.GetCap() : wxCAP_INVALID;
+ wxPenJoin oldJoin = m_pen.IsOk() ? m_pen.GetJoin() : wxJOIN_INVALID;
m_pen = pen;
+ wxPenCap cap = m_pen.IsOk() ? m_pen.GetCap() : wxCAP_INVALID;
+ wxPenJoin join = m_pen.IsOk() ? m_pen.GetJoin() : wxJOIN_INVALID;
double width;
PsPrint( " setdash\n" );
}
+ if ( cap != wxCAP_INVALID && cap != oldCap )
+ {
+ switch ( cap )
+ {
+ case wxCAP_ROUND: buffer = "1"; break;
+ case wxCAP_PROJECTING: buffer = "2"; break;
+ case wxCAP_BUTT: buffer = "0"; break;
+
+ // This case is just to fix compiler warning, this is impossible
+ // due to the test above.
+ case wxCAP_INVALID: break;
+ }
+ buffer << " setlinecap\n";
+ PsPrint( buffer );
+ }
+
+ if ( join != wxJOIN_INVALID && join != oldJoin )
+ {
+ switch ( join )
+ {
+ case wxJOIN_BEVEL: buffer = "2"; break;
+ case wxJOIN_ROUND: buffer = "1"; break;
+ case wxJOIN_MITER: buffer = "0"; break;
+ case wxJOIN_INVALID: break;
+ }
+ buffer << " setlinejoin\n";
+ PsPrint( buffer );
+ }
+
// Line colour
unsigned char red = m_pen.GetColour().Red();
unsigned char blue = m_pen.GetColour().Blue();