From 55526a100a7f63d37ec78d0796a238659cc77c1a Mon Sep 17 00:00:00 2001 From: Baranovskiy Konstantin Date: Wed, 20 Feb 2013 15:26:34 -0500 Subject: [PATCH] DXF plot layer color bug fix. (fixes lp:1126403) --- common/common_plotDXF_functions.cpp | 53 +++++++++++++++-------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/common/common_plotDXF_functions.cpp b/common/common_plotDXF_functions.cpp index 583a7623c0..16036a4ea4 100644 --- a/common/common_plotDXF_functions.cpp +++ b/common/common_plotDXF_functions.cpp @@ -171,30 +171,30 @@ bool DXF_PLOTTER::StartPlot() const char *name; int color; } dxf_layer[NBCOLOR] = { - { "Black", 250 }, - { "Blue", 5 }, - { "Green", 3 }, - { "Cyan", 4 }, - { "Red", 1 }, - { "Magenta", 6 }, - { "Brown", 54 }, - { "LightGray", 9 }, - { "DarkGray", 8 }, - { "LightBlue", 171 }, - { "LightGreen", 91 }, - { "LightCyan", 131 }, - { "LightRed", 11 }, - { "LightMagenta", 221 }, - { "Yellow", 2 }, - { "White", 7 }, - { "DarkDarkGray", 251 }, - { "DarkBlue", 178 }, - { "DarkGreen", 98 }, - { "DarkCyan", 138 }, - { "DarkRed", 18 }, - { "DarkMagenta", 228 }, - { "DarkBrown", 58 }, - { "LightYellow", 51 }, + { "BLACK", 250 }, + { "BLUE", 5 }, + { "GREEN", 3 }, + { "CYAN", 4 }, + { "RED", 1 }, + { "MAGENTA", 6 }, + { "BROWN", 54 }, + { "LIGHTGRAY", 9 }, + { "DARKGRAY", 8 }, + { "LIGHTBLUE", 171 }, + { "LIGHTGREEN", 91 }, + { "LIGHTCYAN", 131 }, + { "LIGHTRED", 11 }, + { "LIGHTMAGENTA", 221 }, + { "YELLOW", 2 }, + { "WHITE", 7 }, + { "DARKDARKGRAY", 251 }, + { "DARKBLUE", 178 }, + { "DARKGREEN", 98 }, + { "DARKCYAN", 138 }, + { "DARKRED", 18 }, + { "DARKMAGENTA", 228 }, + { "DARKBROWN", 58 }, + { "LIGHTYELLOW", 51 }, }; for( int i = 0; i < NBCOLOR; i++ ) @@ -256,6 +256,8 @@ void DXF_PLOTTER::SetColor( EDA_COLOR_T color ) { currentColor = color; } + else + currentColor = BLACK; } /** @@ -567,8 +569,7 @@ void DXF_PLOTTER::Text( const wxPoint& aPos, /* Emit text as a text entity. This loses formatting and shape but it's more useful as a CAD object */ DPOINT origin_dev = userToDeviceCoordinates( aPos ); - if( aColor >= 0 ) - currentColor = aColor; + SetColor( aColor ); wxString cname = ColorRefs[currentColor].m_Name; DPOINT size_dev = userToDeviceSize( aSize ); int h_code = 0, v_code = 0;