X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bdbcded6a32fc216283b9af03267e02fc915448f..b63b07a809f9a3d22596d4971ef5c8971153823a:/src/generic/dcpsg.cpp diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index 8286033876..d7477c3892 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -613,7 +613,7 @@ void wxPostScriptDC::DoDrawPolygon (int n, wxPoint points[], wxCoord xoffset, wx } } -void wxPostScriptDC::DoDrawPolyPolygon (int n, int start[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle) +void wxPostScriptDC::DoDrawPolyPolygon (int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle) { wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); @@ -626,7 +626,7 @@ void wxPostScriptDC::DoDrawPolyPolygon (int n, int start[], wxPoint points[], wx PsPrint( "newpath\n" ); int ofs = 0; - for (int i = 0; i < n; ofs += start[i++]) + for (int i = 0; i < n; ofs += count[i++]) { wxCoord xx = LogicalToDeviceX(points[ofs].x + xoffset); wxCoord yy = LogicalToDeviceY(points[ofs].y + yoffset); @@ -635,7 +635,7 @@ void wxPostScriptDC::DoDrawPolyPolygon (int n, int start[], wxPoint points[], wx CalcBoundingBox( points[ofs].x + xoffset, points[ofs].y + yoffset ); - for (int j = 1; j < start[i]; j++) + for (int j = 1; j < count[i]; j++) { xx = LogicalToDeviceX(points[ofs+j].x + xoffset); yy = LogicalToDeviceY(points[ofs+j].y + yoffset); @@ -655,7 +655,7 @@ void wxPostScriptDC::DoDrawPolyPolygon (int n, int start[], wxPoint points[], wx PsPrint( "newpath\n" ); int ofs = 0; - for (int i = 0; i < n; ofs += start[i++]) + for (int i = 0; i < n; ofs += count[i++]) { wxCoord xx = LogicalToDeviceX(points[ofs].x + xoffset); wxCoord yy = LogicalToDeviceY(points[ofs].y + yoffset); @@ -664,7 +664,7 @@ void wxPostScriptDC::DoDrawPolyPolygon (int n, int start[], wxPoint points[], wx CalcBoundingBox( points[ofs].x + xoffset, points[ofs].y + yoffset ); - for (int j = 1; j < start[i]; j++) + for (int j = 1; j < count[i]; j++) { xx = LogicalToDeviceX(points[ofs+j].x + xoffset); yy = LogicalToDeviceY(points[ofs+j].y + yoffset); @@ -695,8 +695,8 @@ void wxPostScriptDC::DoDrawLines (int n, wxPoint points[], wxCoord xoffset, wxCo CalcBoundingBox( LogicalToDeviceX(points[i].x+xoffset), LogicalToDeviceY(points[i].y+yoffset)); } - PsPrintf( wxT("newpath\n" - "%d %d moveto\n"), + PsPrintf( wxT("newpath\n") + wxT("%d %d moveto\n"), LogicalToDeviceX(points[0].x+xoffset), LogicalToDeviceY(points[0].y+yoffset) ); @@ -1011,6 +1011,10 @@ void wxPostScriptDC::SetFont( const wxFont& font ) } } + // We may legitimately call SetFont before BeginDoc + if (!m_pstream) + return; + PsPrint( name ); PsPrint( " reencodeISO def\n" ); PsPrint( name ); @@ -1673,8 +1677,8 @@ void wxPostScriptDC::DoDrawSpline( wxList *points ) next-to-last and last point respectively, in the point list */ - PsPrintf( wxT("%d %d lineto\n" - "stroke\n"), + PsPrintf( wxT("%d %d lineto\n") + wxT("stroke\n"), LogicalToDeviceX((wxCoord)c), LogicalToDeviceY((wxCoord)d) ); }