Ticket #1244: 1244.patch

File 1244.patch, 1.5 KB (added by oneeyeman, 6 years ago)

First try to implementation

  • wxWidgets/src/generic/dcpsg.cpp

    diff -bru wxWidgets/src/generic/dcpsg.cpp /mnt/winxp/wxWidgets/src/generic/dcpsg.cpp
    old new  
    11361136    if (!pen.IsOk()) return;
    11371137
    11381138    int oldStyle = m_pen.IsOk() ? m_pen.GetStyle() : wxPENSTYLE_INVALID;
     1139    wxPenCap oldCap = m_pen.IsOk() ? m_pen.GetCap() : wxCAP_INVALID;
     1140    wxPenJoin oldJoin = m_pen.IsOk() ? m_pen.GetJoin() : wxJOIN_INVALID;
    11391141
    11401142    m_pen = pen;
     1143    wxPenCap cap = m_pen.IsOk() ? m_pen.GetCap() : wxCAP_INVALID;
     1144    wxPenJoin join = m_pen.IsOk() ? m_pen.GetJoin() : wxJOIN_INVALID;
    11411145
    11421146    double width;
    11431147
     
    12011205        PsPrint( " setdash\n" );
    12021206    }
    12031207
     1208    switch( cap )
     1209        {
     1210        case wxCAP_ROUND:      buffer << 1; break;
     1211                case wxCAP_PROJECTING: buffer << 2; break;
     1212                case wxCAP_BUTT:
     1213        default:               buffer << 0; break;
     1214        }
     1215        buffer << " setlinecap\n";
     1216    if( cap != wxCAP_INVALID && oldCap != cap )
     1217        PsPrint( buffer );
     1218    switch( join )
     1219        {
     1220        case wxJOIN_BEVEL: buffer << 2; break;
     1221        case wxJOIN_ROUND: buffer << 1; break;
     1222        case wxJOIN_MITER:
     1223        default:           buffer << 0; break;
     1224        }
     1225        buffer << " setlinejoin\n";
     1226    if( join != wxJOIN_INVALID && oldJoin != join )
     1227        PsPrint( buffer );
    12041228    // Line colour
    12051229    unsigned char red = m_pen.GetColour().Red();
    12061230    unsigned char blue = m_pen.GetColour().Blue();