|
From: Ethan A M. <merritt@u.washington.edu> - 2006-03-14 19:33:08
|
On Tuesday 14 March 2006 09:42 am, Ethan A Merritt wrote:
> > /* let the terminal make the palette from the supplied RGB triplets */
> > term->make_palette(&sm_palette);
>
> This is where we would like to implement Daniel's proposed
> non-redundancy test
Doh! Actually, it isn't. x11 does its own palette maintenance,
and gets called at the earlier call site.
That makes it all even easier.
Please test the following trivial patch and see if it solves whatever
problems you were having.
Also test for bad interactions with other terminal types.
--- gnuplot/src/color.c 2006-02-19 21:09:15.000000000 -0800
+++ gnuplot-cvs/src/color.c 2006-03-14 11:25:47.000000000 -0800
@@ -115,7 +115,13 @@
It will not change palette passed below, but non-NULL has to be
passed there to create the header or force its initialization
*/
- term->make_palette(&sm_palette);
+
+ if (memcmp(&save_pal, &sm_palette, sizeof(t_sm_palette))) {
+ term->make_palette(&sm_palette);
+ save_pal = sm_palette;
+ FPRINTF((stderr,"make_palette: calling term->make_palette for term with ncolors == 0\n"));
+ } else
+ FPRINTF((stderr,"make_palette: skipping duplicate palette for term with ncolors == 0\n"));
return 0;
}
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|