From: sfeam <sf...@us...> - 2016-09-26 16:36:21
|
On Monday, 26 September 2016 10:04:26 AM Petr Mikulik wrote: > >> I suppose the routine set_plot_with_palette() could be taught to check > >> for object colors also, but I wonder if the better question is why should > >> we not always initialize the palette even if no one is going to use it? > > > > Yes, that could work. This would also automatically alleviate the > > question of any other plot element we might have forgot that potentially > > needs the palette but doesn't trigger it on its own. > > > > I wonder, though, if there are any careless assumptions about the > > palette in the code, for example "palette is initialized => draw the > > colorbox", or in other words, initializing it all the time might expose > > some unwanted side effects. > > There is some overhead with the palette code in terminals - they need more > init data (sending the palette, allocate more colours, write larger postscript > header, ...), as well as switching on the colorbox. Thus searching all objects > for their requirements is a prefered way. OK. Can you think of any additional cases where the current checks in set_plot_with_palette() fail to notice that a palette will be referenced? Ethan |