Shift colorID evaluation to a place after svg_stropts is read.

Remove unused.
This commit is contained in:
Holger Vogt 2021-03-16 11:01:54 +01:00
parent 914604bfab
commit 4303534f91
1 changed files with 10 additions and 20 deletions

View File

@ -123,13 +123,7 @@ const char *colors[] = {"black",
"#949494", /*19: gray for smith grid */ "#949494", /*19: gray for smith grid */
"#888"}; /*20: gray for normal grid */ "#888"}; /*20: gray for normal grid */
void SVG_LinestyleColor(int linestyleid, int colorid);
void SVG_SelectColor(int colorid);
void SVG_Stroke(void);
/* Set scale, color and size of the plot */ /* Set scale, color and size of the plot */
int int
SVG_Init(void) SVG_Init(void)
{ {
@ -137,17 +131,6 @@ SVG_Init(void)
unsigned int colorid, i; unsigned int colorid, i;
struct variable *vb, *va; struct variable *vb, *va;
/* Look for colour overrides: HTML/X11 #xxxxxx style. */
for (colorid = 0; colorid < NUMELEMS(colors); ++colorid) {
sprintf(colorN, "color%d", colorid);
if (cp_getvar(colorN, CP_STRING, colorstring, sizeof(colorstring))) {
colors[colorid] = strdup(colorstring);
if (colorid == 0)
Cfg.strings[SVG_BACKGROUND] = colors[colorid];
}
}
/* plot size */ /* plot size */
if (!cp_getvar("hcopywidth", CP_STRING, &Cfg.ints[SVG_WIDTH], sizeof(Cfg.ints[SVG_WIDTH]))) { if (!cp_getvar("hcopywidth", CP_STRING, &Cfg.ints[SVG_WIDTH], sizeof(Cfg.ints[SVG_WIDTH]))) {
dispdev->width = Cfg.ints[SVG_WIDTH]; dispdev->width = Cfg.ints[SVG_WIDTH];
@ -212,14 +195,22 @@ SVG_Init(void)
} }
} }
/* Get other options. */ /* Look for colour overrides: HTML/X11 #xxxxxx style. */
for (colorid = 0; colorid < NUMELEMS(colors); ++colorid) {
sprintf(colorN, "color%d", colorid);
if (cp_getvar(colorN, CP_STRING, colorstring, sizeof(colorstring))) {
colors[colorid] = strdup(colorstring);
if (colorid == 0)
Cfg.strings[SVG_BACKGROUND] = colors[0];
}
}
/* Get other options. */
if (SVGgrid_width == 0) if (SVGgrid_width == 0)
SVGgrid_width = (2 * SVGstroke_width) / 3; SVGgrid_width = (2 * SVGstroke_width) / 3;
if (SVGuse_color == 0) { if (SVGuse_color == 0) {
/* Black and white. */ /* Black and white. */
dispdev->numcolors = 2; dispdev->numcolors = 2;
} else { } else {
dispdev->numcolors = NUMELEMS(colors); dispdev->numcolors = NUMELEMS(colors);
@ -239,7 +230,6 @@ SVG_Init(void)
} }
/* Plot and fill bounding box */ /* Plot and fill bounding box */
int int
SVG_NewViewport(GRAPH *graph) SVG_NewViewport(GRAPH *graph)
{ {