Dan Mueth wrote:
>
> Hi everybody,
> I finally decided to get my hands dirty and figure this out. It looks
> like the program (figinset.C) has a bug in it. It essentially keeps track
> of the boolean variable gs_color which stores whether there is a local
> color colormap (as opposed to a local gray colormap). The problem is that
> when it decides how to render the EPS images, it decides based on
> gs_color. Thus, if you don't need a local colormap (ie. you have
> StaticColor or TrueColor), it incorrectly concludes that it should render
> the EPS in gray.
>
> The solution was to define a boolean variable, color_visual, which
> stores whether the visual is color(based on the visual class obtained in
> InitFigures()), and to use this to determine if it should be rendered in
> gray or color.
>
> The patch (for src/figinset.C in lyx-1.0.3) follows this email. I would
> appreciate it if somebody could test this out on visual classes besides
> TrueColor(I know this one works). For some reason, lyx dumps core on
> anything but TrueColor for me, even with the unpatched RPM and when I'm
> starting lyx without an argument/document). (Has anybody else had this
> problem?) I'd like to make sure this works properly before merging it
> into the main tree.
>
> Dan
>
> --------------------------------------------------------
> 111a112
> > static bool color_visual; // is the visual color?
> 389a391,396
> > if ( (vi->c_class == StaticColor) ||
> > (vi->c_class == PseudoColor) ||
> > (vi->c_class == TrueColor) ||
> > (vi->c_class == DirectColor) ) color_visual = true;
> > else
> > color_visual = false;
> 621c628
> < if (gs_color && !gs_gray)
> ---
> > if (color_visual)
How about:
color_visual = ( (vi->c_class == StaticColor) ||
(vi->c_class == PseudoColor) ||
(vi->c_class == TrueColor) ||
(vi->c_class == DirectColor) );
or
color_visual = ( vi->c_class == (StaticColor
||PseudoColor ||TrueColor || DirectColor) );
excuse me if this is really dumb.
Garst