allow 0 width lines (faster device dependent implementation) if user defined line width is set (to 0), add devices/title-3.sym

This commit is contained in:
stefan schippers 2023-01-07 11:28:28 +01:00
parent 709c37429d
commit 4c0d5023f5
6 changed files with 52 additions and 15 deletions

View File

@ -1860,7 +1860,7 @@ static void set_thick_waves(int what, int wcnt, int wave_col, Graph_ctx *gr)
} else {
if(gr->hilight_wave == wcnt)
XSetLineAttributes (display, xctx->gc[wave_col],
INT_WIDTH(xctx->lw) ,LineSolid, CapRound , JoinRound);
(int)(xctx->lw) ,LineSolid, CapRound , JoinRound);
}
}

View File

@ -467,6 +467,7 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
xctx->rectcolor= 4; /* this is the current layer when xschem started. */
xctx->currsch = 0;
xctx->ui_state = 0;
xctx->lw = -1.0;
xctx->need_reb_sel_arr = 1;
xctx->lastsel = 0;
xctx->maxsel = 0;
@ -1702,13 +1703,12 @@ int new_schematic(const char *what, const char *win_path, const char *fname)
void change_linewidth(double w)
{
int i, changed;
int i, changed = 0, linew;
double oldw = xctx->lw;
changed=0;
/* choose line width automatically based on zoom */
if(w<0.) {
if(w<0. || xctx->lw == -1.0) {
double cs;
changed=1;
cs = tclgetdoublevar("cadsnap");
if(tclgetboolvar("change_lw")) {
xctx->lw=xctx->mooz * 0.09 * cs;
@ -1717,15 +1717,18 @@ void change_linewidth(double w)
/* explicitly set line width */
} else {
xctx->lw=w;
changed=1;
}
if(xctx->lw != oldw) {
changed = 1;
}
if(!changed) return;
if(has_x) {
linew = INT_WIDTH(xctx->lw);
dbg(1, "Line width = %d\n", linew);
for(i=0;i<cadlayers;i++) {
XSetLineAttributes (display, xctx->gc[i], INT_WIDTH(xctx->lw), LineSolid, CapRound , JoinRound);
XSetLineAttributes (display, xctx->gc[i], linew, LineSolid, CapRound , JoinRound);
}
XSetLineAttributes (display, xctx->gctiled, INT_WIDTH(xctx->lw), LineSolid, CapRound , JoinRound);
XSetLineAttributes (display, xctx->gctiled, linew, LineSolid, CapRound , JoinRound);
}
if(!xctx->only_probes) {
xctx->areax1 = -2*INT_WIDTH(xctx->lw);

View File

@ -369,7 +369,7 @@ do { \
} \
} while(0)
#define INT_WIDTH(x) ( (int)(x) == 0 ? 1 : (int)(x) )
#define INT_WIDTH(x) ( tclgetboolvar("change_lw") ? ( (int)(x) == 0 ? 1 : (int)(x) ) : (int)(x) )
#define INT_BUS_WIDTH(x) ( (int)( (BUS_WIDTH) * (x) ) == 0 ? 1 : (int)( (BUS_WIDTH) * (x) ) )
/* set do double if you need more precision at the expense of memory */

View File

@ -1,4 +1,5 @@
v {xschem version=3.0.0 file_version=1.2 }
v {xschem version=3.1.0 file_version=1.2
}
G {}
K {type=logo
template="name=l1 author=\\"Stefan Schippers\\" rev=1.0 lock=true"
@ -12,9 +13,9 @@ S {}
E {}
L 4 385 0 3430 0 {}
L 4 0 0 65 0 {}
L 4 3430 -2350 3430 0 {}
L 4 0 -2350 3430 -2350 {}
L 4 0 -2350 0 0 {}
L 4 3430 -2430 3430 0 {}
L 4 0 -2430 3430 -2430 {}
L 4 0 -2430 0 0 {}
L 4 2110 -160 2110 0 {}
L 4 2110 -160 3430 -160 {}
L 4 2110 -80 3430 -80 {}

View File

@ -0,0 +1,31 @@
v {xschem version=3.1.0 file_version=1.2
}
G {}
K {type=logo
template="name=l1 author=\\"Stefan Schippers\\" rev=1.0 lock=true"
verilog_ignore=true
vhdl_ignore=true
spice_ignore=true
tedax_ignore=true
}
V {}
S {}
E {}
L 4 385 0 2500 0 {}
L 4 0 0 65 0 {}
L 4 2500 -1770 2500 0 {}
L 4 0 -1770 2500 -1770 {}
L 4 0 -1770 0 0 {}
L 4 1180 -160 1180 0 {}
L 4 1180 -160 2500 -160 {}
L 4 1180 -80 2500 -80 {}
L 4 1810 -80 1810 0 {}
L 4 1810 -160 1810 -80 {}
L 4 1520 -80 1520 0 {}
P 5 13 165 -30 135 0 165 30 145 30 125 10 105 30 85 30 115 0 85 -30 105 -30 125 -10 145 -30 165 -30 {fill=true}
T {SCHEM} 165 -25 0 0 1 1 {}
T {@time_last_modified} 1820 -60 0 0 0.8 0.8 {}
T {@author} 1190 -140 0 0 0.8 0.8 {}
T {Page @page of @pages} 1190 -60 0 0 0.8 0.8 {}
T {@title} 1820 -120 0 0 0.6 0.6 {vcenter=true}
T {Rev. @rev} 1530 -60 0 0 0.8 0.8 {}

View File

@ -1,4 +1,5 @@
v {xschem version=2.9.8 file_version=1.2}
v {xschem version=3.1.0 file_version=1.2
}
G {}
K {}
V {}
@ -111,3 +112,4 @@ C {spice_probe.sym} 780 -470 0 0 {name=p1 analysis=tran}
C {spice_probe.sym} 90 -640 0 0 {name=p2 analysis=tran}
C {spice_probe.sym} 410 -460 0 0 {name=p3 analysis=tran}
C {spice_probe.sym} 290 -400 0 0 {name=p4 analysis=tran}
C {title-2.sym} -170 100 0 0 {name=l11 author="Stefan Schippers" rev=1.0 lock=false}