parent
49a9fe38a0
commit
bbfc5c272e
|
@ -95,31 +95,28 @@ void GRSetColorPen( wxDC* DC, const COLOR4D& Color, int width, wxPenStyle style
|
||||||
// wxWidgets will enforce a minimum pen width when printing, so we have to make the pen
|
// wxWidgets will enforce a minimum pen width when printing, so we have to make the pen
|
||||||
// transparent when we don't want the object stroked.
|
// transparent when we don't want the object stroked.
|
||||||
if( width == 0 )
|
if( width == 0 )
|
||||||
|
{
|
||||||
color = COLOR4D::UNSPECIFIED;
|
color = COLOR4D::UNSPECIFIED;
|
||||||
|
style = wxPENSTYLE_TRANSPARENT;
|
||||||
|
}
|
||||||
|
|
||||||
const wxPen& curr_pen = DC->GetPen();
|
const wxPen& curr_pen = DC->GetPen();
|
||||||
|
|
||||||
if( !curr_pen.IsOk() || curr_pen.GetColour() != color.ToColour()
|
if( !curr_pen.IsOk() || curr_pen.GetColour() != color.ToColour()
|
||||||
|| curr_pen.GetWidth() != width || curr_pen.GetStyle() != style )
|
|| curr_pen.GetWidth() != width || curr_pen.GetStyle() != style )
|
||||||
{
|
{
|
||||||
if( width == 0 )
|
wxPen pen;
|
||||||
// COLOR4D::UNSPECIFIED (i.e. opacity = 0) does not work on all platforms
|
pen.SetColour( color.ToColour() );
|
||||||
// So ensure the pen is transparent
|
|
||||||
DC->SetPen( *wxTRANSPARENT_PEN );
|
if( style == wxPENSTYLE_DOT )
|
||||||
else
|
|
||||||
{
|
{
|
||||||
wxPen pen;
|
style = wxPENSTYLE_USER_DASH;
|
||||||
pen.SetColour( color.ToColour() );
|
pen.SetDashes( 2, dots );
|
||||||
|
|
||||||
if( style == wxPENSTYLE_DOT )
|
|
||||||
{
|
|
||||||
style = wxPENSTYLE_USER_DASH;
|
|
||||||
pen.SetDashes( 2, dots );
|
|
||||||
}
|
|
||||||
|
|
||||||
pen.SetWidth( width );
|
|
||||||
pen.SetStyle( style );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pen.SetWidth( width );
|
||||||
|
pen.SetStyle( style );
|
||||||
|
DC->SetPen( pen );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue