Commit 27386696 authored by peud's avatar peud

PS plotting was broken in B/W mode, made neccessary changes.

parent 22f66571
......@@ -72,20 +72,40 @@ void PS_Plotter::set_color( int color )
*/
{
wxASSERT(output_file);
if ((color >= 0 && color_mode)
|| (color == BLACK)
|| (color == WHITE))
/* Return at invalid color index */
if(color < 0)
return;
if(color_mode)
{
if (negative_mode)
{
fprintf( output_file, "%.3g %.3g %.3g setrgbcolor\n",
(double) 1.0-ColorRefs[color].m_Red / 255,
(double) 1.0-ColorRefs[color].m_Green / 255,
(double) 1.0-ColorRefs[color].m_Blue / 255 );
} else
{
fprintf( output_file, "%.3g %.3g %.3g setrgbcolor\n",
(double) ColorRefs[color].m_Red / 255,
(double) ColorRefs[color].m_Green / 255,
(double) ColorRefs[color].m_Blue / 255 );
}
}
else /* B/W Mode - Use BLACK for all items */
{
if (negative_mode)
fprintf( output_file, "%.3g %.3g %.3g setrgbcolor\n",
(double) 1.0-ColorRefs[color].m_Red / 255,
(double) 1.0-ColorRefs[color].m_Green / 255,
(double) 1.0-ColorRefs[color].m_Blue / 255 );
else
fprintf( output_file, "%.3g %.3g %.3g setrgbcolor\n",
(double) ColorRefs[color].m_Red / 255,
(double) ColorRefs[color].m_Green / 255,
(double) ColorRefs[color].m_Blue / 255 );
/* Why invert in this mode. Does anyway WHITE! */
if (negative_mode)
fprintf( output_file, "%.3g %.3g %.3g setrgbcolor\n",
(double) 1.0-ColorRefs[BLACK].m_Red / 255,
(double) 1.0-ColorRefs[BLACK].m_Green / 255,
(double) 1.0-ColorRefs[BLACK].m_Blue / 255 );
else
fprintf( output_file, "%.3g %.3g %.3g setrgbcolor\n",
(double) ColorRefs[BLACK].m_Red / 255,
(double) ColorRefs[BLACK].m_Green / 255,
(double) ColorRefs[BLACK].m_Blue / 255 );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment