allow independent linewidth and gridwidth settings from within the .control section

This commit is contained in:
Holger Vogt 2019-12-10 00:36:34 +01:00
parent 6a7e9db1e1
commit c000b2042a
3 changed files with 18 additions and 5 deletions

View File

@ -111,10 +111,11 @@ void ft_gnuplot(double *xlims, double *ylims,
/* get linewidth for plotting the graph from .spiceinit */
if (!cp_getvar("xbrushwidth", CP_NUM, &linewidth, 0))
linewidth = 1;
if (linewidth < 1) linewidth = 1;
if (linewidth < 1)
linewidth = 1;
/* get linewidth for grid from .spiceinit */
if (!cp_getvar("gridwidth", CP_NUM, &gridlinewidth, 0))
gridlinewidth = linewidth;
gridlinewidth = 1;
if (gridlinewidth < 1)
gridlinewidth = 1;

View File

@ -152,7 +152,7 @@ X11_Init(void)
return (1);
}
if (cp_getvar("old_x11", CP_BOOL, NULL))
if (cp_getvar("old_x11", CP_BOOL, NULL, 0))
old_x11 = TRUE;
# ifdef DEBUG
@ -478,7 +478,7 @@ X11_NewViewport(GRAPH *graph)
}
/* font size */
if (!cp_getvar("xfont_size", CP_NUM, &xfont_size))
if (!cp_getvar("xfont_size", CP_NUM, &xfont_size, 0))
xfont_size = 16;
if(old_x11) {

View File

@ -3,7 +3,7 @@
* Wolfgang Muees 27.10.97
* Holger Vogt 07.12.01
* Holger Vogt 05.12.07
* Holger Vogt 01.11.18
* Holger Vogt 01.11.18
*/
#include "ngspice/ngspice.h"
@ -823,6 +823,18 @@ int WIN_NewViewport(GRAPH *graph)
graph->absolute.width = wd->Area.right;
graph->absolute.height = wd->Area.bottom;
/* get linewidth information from .spiceinit or .control section */
if (!cp_getvar("xbrushwidth", CP_NUM, &linewidth, 0))
linewidth = 0;
if (linewidth < 0)
linewidth = 0;
/* get linewidth information from .spiceinit or .control section */
if (!cp_getvar("gridwidth", CP_NUM, &gridlinewidth, 0))
gridlinewidth = 0;
if (gridlinewidth < 0)
gridlinewidth = 0;
/* wait until the window is really there */
WaitForIdle();