From: Ethan M. <merritt@u.washington.edu> - 2004-08-16 21:08:39
|
On Monday 16 August 2004 01:42 pm, Dave Denholm wrote: > > (Come to think of it - I may not even have the latest sources, in > which case what I just wrote may have been rubbish) The particular code bit you posted applies to line colors, not to pm3d rectangles. But there is a similar bit of code in PaletteSetColor(plot_struct * plot, double gray) that applies to pm3d: index = gray * (plot->cmap->allocated - 1); if (index >= plot->cmap->allocated) index = plot->cmap->allocated -1; XSetForeground(dpy, gc_pm3d, plot->cmap->pixels[index]); I don't really have a grasp of the big picture. I *think* the problem is that plot->cmap itself is still only a list of color indices, and since the time it was first set up the true colormap stored in the gc has changed. So the above code updates the index, but it is an index into an obsolete table. That's why I thought we might have to store a copy of the gc in use at the time the original color mapping was set up. Maybe. -- Ethan A Merritt merritt@u.washington.edu Biomolecular Structure Center Mailstop 357742 University of Washington, Seattle, WA 98195 |