Merge branch 'StefanSchippers:master' into master
This commit is contained in:
commit
ad89151100
|
|
@ -1438,6 +1438,7 @@ C {verilog_timescale.sym} 1050 -100 0 0 {name=s1 timestep="1ns" precision="1ns"
|
|||
<li><kbd> cadgrid </kbd> set cad grid (default: 20) </li>
|
||||
<li><kbd> cadsnap </kbd> set mouse snap (default: 10) </li>
|
||||
<li><kbd> color_ps </kbd> set color psoscript (1 or 0) </li>
|
||||
<li><kbd> crosshair_layer </kbd> set layer for mouse crosshair </li>
|
||||
<li><kbd> constr_mv </kbd> set constrained move (1=horiz, 2=vert, 0=none) </li>
|
||||
<li><kbd> cursor1_x </kbd> set graph cursor1 position </li>
|
||||
<li><kbd> cursor2_x </kbd> set graph cursor2 position </li>
|
||||
|
|
|
|||
123
src/callback.c
123
src/callback.c
|
|
@ -83,9 +83,11 @@ static int waves_selected(int event, KeySym key, int state, int button)
|
|||
if(!is_inside) {
|
||||
xctx->graph_master = -1;
|
||||
xctx->ui_state &= ~GRAPHPAN; /* terminate ongoing GRAPHPAN to avoid deadlocks */
|
||||
if(draw_xhair)
|
||||
tclvareval(xctx->top_path, ".drw configure -cursor none" , NULL);
|
||||
else
|
||||
if(draw_xhair) {
|
||||
if(tclgetintvar("crosshair_size") == 0) {
|
||||
tclvareval(xctx->top_path, ".drw configure -cursor none" , NULL);
|
||||
}
|
||||
} else
|
||||
tclvareval(xctx->top_path, ".drw configure -cursor {}" , NULL);
|
||||
if(xctx->graph_flags & 64) {
|
||||
tcleval("graph_show_measure stop");
|
||||
|
|
@ -1355,36 +1357,103 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
void draw_crosshair(int what)
|
||||
{
|
||||
int sdw, sdp;
|
||||
int xhair_size = tclgetintvar("crosshair_size");;
|
||||
dbg(1, "draw_crosshair(): what=%d\n", what);
|
||||
sdw = xctx->draw_window;
|
||||
sdp = xctx->draw_pixmap;
|
||||
|
||||
if(!xctx->mouse_inside) return;
|
||||
|
||||
xctx->draw_pixmap = 0;
|
||||
xctx->draw_window = 1;
|
||||
if(what != 2) {
|
||||
if(what != 2) { /* delete previous */
|
||||
if(fix_broken_tiled_fill || !_unix) {
|
||||
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
|
||||
0, (int)Y_TO_SCREEN(xctx->prev_crossy) - 2 * INT_WIDTH(xctx->lw),
|
||||
xctx->xrect[0].width, 4 * INT_WIDTH(xctx->lw),
|
||||
0, (int)Y_TO_SCREEN(xctx->prev_crossy) - 2 * INT_WIDTH(xctx->lw));
|
||||
if(xhair_size) {
|
||||
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
|
||||
(int)X_TO_SCREEN(xctx->prev_crossx) - 2 * INT_WIDTH(xctx->lw) - xhair_size,
|
||||
(int)Y_TO_SCREEN(xctx->prev_crossy) - 2 * INT_WIDTH(xctx->lw) - xhair_size,
|
||||
4 * INT_WIDTH(xctx->lw) + 4 * xhair_size,
|
||||
4 * INT_WIDTH(xctx->lw) + 4 * xhair_size,
|
||||
(int)X_TO_SCREEN(xctx->prev_crossx) - 2 * INT_WIDTH(xctx->lw) - xhair_size,
|
||||
(int)Y_TO_SCREEN(xctx->prev_crossy) - 2 * INT_WIDTH(xctx->lw) - xhair_size);
|
||||
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
|
||||
(int)X_TO_SCREEN(xctx->prev_crossx) - 2 * INT_WIDTH(xctx->lw) - xhair_size,
|
||||
(int)Y_TO_SCREEN(xctx->prev_crossy) - 2 * INT_WIDTH(xctx->lw) - xhair_size,
|
||||
4 * INT_WIDTH(xctx->lw) + 4 * xhair_size,
|
||||
4 * INT_WIDTH(xctx->lw) + 4 * xhair_size,
|
||||
(int)X_TO_SCREEN(xctx->prev_crossx) - 2 * INT_WIDTH(xctx->lw) - xhair_size,
|
||||
(int)Y_TO_SCREEN(xctx->prev_crossy) - 2 * INT_WIDTH(xctx->lw) - xhair_size);
|
||||
} else { /* full screen span xhair */
|
||||
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
|
||||
0, (int)Y_TO_SCREEN(xctx->prev_crossy) - 2 * INT_WIDTH(xctx->lw),
|
||||
xctx->xrect[0].width, 4 * INT_WIDTH(xctx->lw),
|
||||
0, (int)Y_TO_SCREEN(xctx->prev_crossy) - 2 * INT_WIDTH(xctx->lw));
|
||||
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
|
||||
(int)X_TO_SCREEN(xctx->prev_crossx) - 2 * INT_WIDTH(xctx->lw), 0,
|
||||
4 * INT_WIDTH(xctx->lw), xctx->xrect[0].height,
|
||||
(int)X_TO_SCREEN(xctx->prev_crossx) - 2 * INT_WIDTH(xctx->lw), 0);
|
||||
}
|
||||
|
||||
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
|
||||
(int)X_TO_SCREEN(xctx->prev_crossx) - 2 * INT_WIDTH(xctx->lw), 0,
|
||||
4 * INT_WIDTH(xctx->lw), xctx->xrect[0].height,
|
||||
(int)X_TO_SCREEN(xctx->prev_crossx) - 2 * INT_WIDTH(xctx->lw), 0);
|
||||
} else {
|
||||
drawtempline(xctx->gctiled, NOW, X_TO_XSCHEM(xctx->areax1),
|
||||
xctx->prev_crossy, X_TO_XSCHEM(xctx->areax2), xctx->prev_crossy);
|
||||
drawtempline(xctx->gctiled, NOW, xctx->prev_crossx, Y_TO_XSCHEM(xctx->areay1),
|
||||
xctx->prev_crossx, Y_TO_XSCHEM(xctx->areay2));
|
||||
} else {
|
||||
if(xhair_size) {
|
||||
draw_xhair_line(xctx->gctiled, xhair_size,
|
||||
X_TO_SCREEN(xctx->prev_crossx) - xhair_size,
|
||||
Y_TO_SCREEN(xctx->prev_crossy) - xhair_size,
|
||||
X_TO_SCREEN(xctx->prev_crossx) + xhair_size,
|
||||
Y_TO_SCREEN(xctx->prev_crossy) - xhair_size);
|
||||
draw_xhair_line(xctx->gctiled, xhair_size,
|
||||
X_TO_SCREEN(xctx->prev_crossx) - xhair_size,
|
||||
Y_TO_SCREEN(xctx->prev_crossy) + xhair_size,
|
||||
X_TO_SCREEN(xctx->prev_crossx) + xhair_size,
|
||||
Y_TO_SCREEN(xctx->prev_crossy) + xhair_size);
|
||||
draw_xhair_line(xctx->gctiled, xhair_size,
|
||||
X_TO_SCREEN(xctx->prev_crossx) - xhair_size,
|
||||
Y_TO_SCREEN(xctx->prev_crossy) - xhair_size,
|
||||
X_TO_SCREEN(xctx->prev_crossx) - xhair_size,
|
||||
Y_TO_SCREEN(xctx->prev_crossy) + xhair_size);
|
||||
draw_xhair_line(xctx->gctiled, xhair_size,
|
||||
X_TO_SCREEN(xctx->prev_crossx) + xhair_size,
|
||||
Y_TO_SCREEN(xctx->prev_crossy) - xhair_size,
|
||||
X_TO_SCREEN(xctx->prev_crossx) + xhair_size,
|
||||
Y_TO_SCREEN(xctx->prev_crossy) + xhair_size);
|
||||
} else { /* full screen span xhair */
|
||||
drawtempline(xctx->gctiled, NOW, X_TO_XSCHEM(xctx->areax1),
|
||||
xctx->prev_crossy, X_TO_XSCHEM(xctx->areax2), xctx->prev_crossy);
|
||||
drawtempline(xctx->gctiled, NOW, xctx->prev_crossx, Y_TO_XSCHEM(xctx->areay1),
|
||||
xctx->prev_crossx, Y_TO_XSCHEM(xctx->areay2));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(what != 1) {
|
||||
drawline(xctx->crosshair_layer, NOW,X_TO_XSCHEM( xctx->areax1), xctx->mousey_snap,
|
||||
X_TO_XSCHEM(xctx->areax2), xctx->mousey_snap, 3, NULL);
|
||||
drawline(xctx->crosshair_layer, NOW, xctx->mousex_snap, Y_TO_XSCHEM(xctx->areay1),
|
||||
xctx->mousex_snap, Y_TO_XSCHEM(xctx->areay2), 3, NULL);
|
||||
if(what != 1) { /* draw new */
|
||||
if(xhair_size) {
|
||||
draw_xhair_line(xctx->gc[xctx->crosshair_layer], xhair_size,
|
||||
X_TO_SCREEN(xctx->mousex_snap) - xhair_size,
|
||||
Y_TO_SCREEN(xctx->mousey_snap) - xhair_size,
|
||||
X_TO_SCREEN(xctx->mousex_snap) + xhair_size,
|
||||
Y_TO_SCREEN(xctx->mousey_snap) - xhair_size);
|
||||
draw_xhair_line(xctx->gc[xctx->crosshair_layer], xhair_size,
|
||||
X_TO_SCREEN(xctx->mousex_snap) - xhair_size,
|
||||
Y_TO_SCREEN(xctx->mousey_snap) + xhair_size,
|
||||
X_TO_SCREEN(xctx->mousex_snap) + xhair_size,
|
||||
Y_TO_SCREEN(xctx->mousey_snap) + xhair_size);
|
||||
draw_xhair_line(xctx->gc[xctx->crosshair_layer], xhair_size,
|
||||
X_TO_SCREEN(xctx->mousex_snap) - xhair_size,
|
||||
Y_TO_SCREEN(xctx->mousey_snap) - xhair_size,
|
||||
X_TO_SCREEN(xctx->mousex_snap) - xhair_size,
|
||||
Y_TO_SCREEN(xctx->mousey_snap) + xhair_size);
|
||||
draw_xhair_line(xctx->gc[xctx->crosshair_layer], xhair_size,
|
||||
X_TO_SCREEN(xctx->mousex_snap) + xhair_size,
|
||||
Y_TO_SCREEN(xctx->mousey_snap) - xhair_size,
|
||||
X_TO_SCREEN(xctx->mousex_snap) + xhair_size,
|
||||
Y_TO_SCREEN(xctx->mousey_snap) + xhair_size);
|
||||
} else { /* full screen span xhair */
|
||||
draw_xhair_line(xctx->gc[xctx->crosshair_layer], xhair_size,
|
||||
xctx->areax1, Y_TO_SCREEN(xctx->mousey_snap),
|
||||
xctx->areax2, Y_TO_SCREEN(xctx->mousey_snap));
|
||||
draw_xhair_line(xctx->gc[xctx->crosshair_layer], xhair_size,
|
||||
X_TO_SCREEN(xctx->mousex_snap), xctx->areay1,
|
||||
X_TO_SCREEN(xctx->mousex_snap), xctx->areay2);
|
||||
}
|
||||
}
|
||||
draw_selection(xctx->gc[SELLAYER], 0);
|
||||
xctx->prev_crossx = xctx->mousex_snap;
|
||||
|
|
@ -2413,9 +2482,11 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
case EnterNotify:
|
||||
dbg(2, "callback(): Enter event, ui_state=%d\n", xctx->ui_state);
|
||||
xctx->mouse_inside = 1;
|
||||
if(draw_xhair)
|
||||
tclvareval(xctx->top_path, ".drw configure -cursor none" , NULL);
|
||||
else
|
||||
if(draw_xhair) {
|
||||
if(tclgetintvar("crosshair_size") == 0) {
|
||||
tclvareval(xctx->top_path, ".drw configure -cursor none" , NULL);
|
||||
}
|
||||
} else
|
||||
tclvareval(xctx->top_path, ".drw configure -cursor {}" , NULL);
|
||||
/* xschem window *sending* selected objects
|
||||
when the pointer comes back in abort copy operation since it has been done
|
||||
|
|
@ -4281,7 +4352,7 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
}
|
||||
|
||||
/* end wire creation when dragging in intuitive interface from an inst pin ow wire endpoint */
|
||||
else if(xctx->intuitive_interface && (xctx->ui_state & STARTWIRE)) {
|
||||
else if(state == Button1Mask && xctx->intuitive_interface && (xctx->ui_state & STARTWIRE)) {
|
||||
if(end_place_move_copy_zoom()) break;
|
||||
}
|
||||
|
||||
|
|
|
|||
133
src/draw.c
133
src/draw.c
|
|
@ -968,14 +968,26 @@ void draw_temp_symbol(int what, GC gc, int n,int layer,short tmp_flip, short rot
|
|||
|
||||
static void drawgrid()
|
||||
{
|
||||
double x,y;
|
||||
double x, y, xax, yax, xx, yy;
|
||||
double delta,tmp;
|
||||
double mult;
|
||||
#if DRAW_ALL_CAIRO==0
|
||||
int i=0;
|
||||
int big_gr = tclgetboolvar("big_grid_points");
|
||||
char dash_arr[2];
|
||||
int axes = tclgetboolvar("draw_grid_axes");
|
||||
|
||||
if(axes) {
|
||||
dash_arr[0] = dash_arr[1] = (char) 3;
|
||||
XSetDashes(display, xctx->gc[GRIDLAYER], 0, dash_arr, 1);
|
||||
if(!big_gr) {
|
||||
XSetLineAttributes (display, xctx->gc[GRIDLAYER],
|
||||
0, xDashType, xCap, xJoin);
|
||||
} else {
|
||||
XSetLineAttributes (display, xctx->gc[GRIDLAYER],
|
||||
XLINEWIDTH(xctx->lw), xDashType, xCap, xJoin);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
dbg(1, "drawgrid(): draw grid\n");
|
||||
if( !tclgetboolvar("draw_grid") || !has_x) return;
|
||||
|
|
@ -994,76 +1006,93 @@ static void drawgrid()
|
|||
|
||||
|
||||
#if DRAW_ALL_CAIRO==1
|
||||
x =floor(xctx->xorigin*xctx->mooz) + 0.5; y = floor(xctx->yorigin*xctx->mooz) + 0.5;
|
||||
xax =floor(xctx->xorigin*xctx->mooz) + 0.5; yax = floor(xctx->yorigin*xctx->mooz) + 0.5;
|
||||
#else
|
||||
x =xctx->xorigin*xctx->mooz; y = xctx->yorigin*xctx->mooz;
|
||||
xax =xctx->xorigin*xctx->mooz; yax = xctx->yorigin*xctx->mooz;
|
||||
#endif
|
||||
if(y > xctx->areay1 && y < xctx->areay2) {
|
||||
if(yax > xctx->areay1 && yax < xctx->areay2) {
|
||||
if(xctx->draw_window) {
|
||||
#if DRAW_ALL_CAIRO==1
|
||||
cairo_move_to(xctx->cairo_ctx, xctx->areax1+1, y);
|
||||
cairo_line_to(xctx->cairo_ctx, xctx->areax2-1, y);
|
||||
cairo_move_to(xctx->cairo_ctx, xctx->areax1+1, yax);
|
||||
cairo_line_to(xctx->cairo_ctx, xctx->areax2-1, yax);
|
||||
#else
|
||||
if(axes) XDrawLine(display, xctx->window, xctx->gc[GRIDLAYER],xctx->areax1+1,(int)y, xctx->areax2-1, (int)y);
|
||||
if(axes) XDrawLine(display, xctx->window, xctx->gc[GRIDLAYER], xctx->areax1+1,
|
||||
(int)yax, xctx->areax2-1, (int)yax);
|
||||
#endif
|
||||
}
|
||||
if(xctx->draw_pixmap) {
|
||||
#if DRAW_ALL_CAIRO==1
|
||||
cairo_move_to(xctx->cairo_save_ctx, xctx->areax1+1, y);
|
||||
cairo_line_to(xctx->cairo_save_ctx, xctx->areax2-1, y);
|
||||
cairo_move_to(xctx->cairo_save_ctx, xctx->areax1+1, yax);
|
||||
cairo_line_to(xctx->cairo_save_ctx, xctx->areax2-1, yax);
|
||||
#else
|
||||
if(axes) XDrawLine(display, xctx->save_pixmap, xctx->gc[GRIDLAYER],xctx->areax1+1,(int)y, xctx->areax2-1, (int)y);
|
||||
if(axes) XDrawLine(display, xctx->save_pixmap, xctx->gc[GRIDLAYER], xctx->areax1+1, (int)yax,
|
||||
xctx->areax2-1, (int)yax);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if(x > xctx->areax1 && x < xctx->areax2) {
|
||||
if(xax > xctx->areax1 && xax < xctx->areax2) {
|
||||
if(xctx->draw_window) {
|
||||
#if DRAW_ALL_CAIRO==1
|
||||
cairo_move_to(xctx->cairo_ctx, x, xctx->areay1+1);
|
||||
cairo_line_to(xctx->cairo_ctx, x, xctx->areay2-1);
|
||||
cairo_move_to(xctx->cairo_ctx, xax, xctx->areay1+1);
|
||||
cairo_line_to(xctx->cairo_ctx, xax, xctx->areay2-1);
|
||||
#else
|
||||
if(axes) XDrawLine(display, xctx->window, xctx->gc[GRIDLAYER],(int)x,xctx->areay1+1, (int)x, xctx->areay2-1);
|
||||
if(axes) XDrawLine(display, xctx->window, xctx->gc[GRIDLAYER], (int)xax, xctx->areay1+1,
|
||||
(int)xax, xctx->areay2-1);
|
||||
#endif
|
||||
}
|
||||
if(xctx->draw_pixmap) {
|
||||
#if DRAW_ALL_CAIRO==1
|
||||
cairo_move_to(xctx->cairo_save_ctx, x, xctx->areay1+1);
|
||||
cairo_line_to(xctx->cairo_save_ctx, x, xctx->areay2-1);
|
||||
cairo_move_to(xctx->cairo_save_ctx, xax, xctx->areay1+1);
|
||||
cairo_line_to(xctx->cairo_save_ctx, xax, xctx->areay2-1);
|
||||
#else
|
||||
if(axes) XDrawLine(display, xctx->save_pixmap, xctx->gc[GRIDLAYER],(int)x,xctx->areay1+1, (int)x, xctx->areay2-1);
|
||||
if(axes) XDrawLine(display, xctx->save_pixmap, xctx->gc[GRIDLAYER], (int)xax, xctx->areay1+1,
|
||||
(int)xax, xctx->areay2-1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
tmp = floor((xctx->areay1+1)/delta)*delta-fmod(-xctx->yorigin*xctx->mooz,delta);
|
||||
for(x=floor((xctx->areax1+1)/delta)*delta-fmod(-xctx->xorigin*xctx->mooz,delta); x < xctx->areax2; x += delta) {
|
||||
#if DRAW_ALL_CAIRO==0
|
||||
if(axes) {
|
||||
XSetLineAttributes (display, xctx->gc[GRIDLAYER],
|
||||
XLINEWIDTH(xctx->lw), LineSolid, LINECAP, LINEJOIN);
|
||||
}
|
||||
#endif
|
||||
|
||||
tmp = floor((xctx->areay1+1)/delta)*delta-fmod(-xctx->yorigin*xctx->mooz, delta);
|
||||
for(x=floor((xctx->areax1+1)/delta)*delta-fmod(-xctx->xorigin*xctx->mooz, delta); x < xctx->areax2; x += delta) {
|
||||
xx = x;
|
||||
#if DRAW_ALL_CAIRO==1
|
||||
double xx = floor(x) + 0.5;
|
||||
xx = floor(x) + 0.5;
|
||||
#endif
|
||||
if((int)xx == (int)xax) continue;
|
||||
for(y=tmp; y < xctx->areay2; y += delta) {
|
||||
yy = y;
|
||||
#if DRAW_ALL_CAIRO==1
|
||||
double yy = floor(y) + 0.5;
|
||||
if(xctx->draw_window) {
|
||||
cairo_move_to(xctx->cairo_ctx, xx, yy) ;
|
||||
cairo_close_path(xctx->cairo_ctx);
|
||||
}
|
||||
if(xctx->draw_pixmap) {
|
||||
cairo_move_to(xctx->cairo_save_ctx, xx, yy);
|
||||
cairo_close_path(xctx->cairo_save_ctx);
|
||||
}
|
||||
yy = floor(y) + 0.5;
|
||||
#endif
|
||||
if((int)yy == (int)yax) continue;
|
||||
#if DRAW_ALL_CAIRO==1
|
||||
if(xctx->draw_window) {
|
||||
cairo_move_to(xctx->cairo_ctx, xx, yy) ;
|
||||
cairo_close_path(xctx->cairo_ctx);
|
||||
}
|
||||
if(xctx->draw_pixmap) {
|
||||
cairo_move_to(xctx->cairo_save_ctx, xx, yy);
|
||||
cairo_close_path(xctx->cairo_save_ctx);
|
||||
}
|
||||
#else
|
||||
if(i>=CADMAXGRIDPOINTS) {
|
||||
if(xctx->draw_window) {
|
||||
if(big_gr) {
|
||||
XDrawSegments(display,xctx->window,xctx->gc[GRIDLAYER],xctx->biggridpoint,i);
|
||||
XDrawSegments(display, xctx->window, xctx->gc[GRIDLAYER], xctx->biggridpoint, i);
|
||||
} else {
|
||||
XDrawPoints(display,xctx->window,xctx->gc[GRIDLAYER],xctx->gridpoint,i,CoordModeOrigin);
|
||||
XDrawPoints(display, xctx->window, xctx->gc[GRIDLAYER], xctx->gridpoint, i, CoordModeOrigin);
|
||||
}
|
||||
}
|
||||
if(xctx->draw_pixmap) {
|
||||
if(big_gr) {
|
||||
XDrawSegments(display,xctx->save_pixmap,xctx->gc[GRIDLAYER],xctx->biggridpoint,i);
|
||||
XDrawSegments(display, xctx->save_pixmap, xctx->gc[GRIDLAYER], xctx->biggridpoint, i);
|
||||
} else {
|
||||
XDrawPoints(display,xctx->save_pixmap,xctx->gc[GRIDLAYER],xctx->gridpoint,i,CoordModeOrigin);
|
||||
XDrawPoints(display, xctx->save_pixmap, xctx->gc[GRIDLAYER], xctx->gridpoint, i, CoordModeOrigin);
|
||||
}
|
||||
}
|
||||
i=0;
|
||||
|
|
@ -1083,16 +1112,16 @@ static void drawgrid()
|
|||
#if DRAW_ALL_CAIRO==0
|
||||
if(xctx->draw_window) {
|
||||
if(big_gr) {
|
||||
XDrawSegments(display,xctx->window,xctx->gc[GRIDLAYER],xctx->biggridpoint,i);
|
||||
XDrawSegments(display, xctx->window, xctx->gc[GRIDLAYER], xctx->biggridpoint, i);
|
||||
} else {
|
||||
XDrawPoints(display,xctx->window,xctx->gc[GRIDLAYER],xctx->gridpoint,i,CoordModeOrigin);
|
||||
XDrawPoints(display, xctx->window, xctx->gc[GRIDLAYER], xctx->gridpoint, i, CoordModeOrigin);
|
||||
}
|
||||
}
|
||||
if(xctx->draw_pixmap) {
|
||||
if(big_gr) {
|
||||
XDrawSegments(display,xctx->save_pixmap,xctx->gc[GRIDLAYER],xctx->biggridpoint,i);
|
||||
XDrawSegments(display, xctx->save_pixmap, xctx->gc[GRIDLAYER], xctx->biggridpoint, i);
|
||||
} else {
|
||||
XDrawPoints(display,xctx->save_pixmap,xctx->gc[GRIDLAYER],xctx->gridpoint,i,CoordModeOrigin);
|
||||
XDrawPoints(display, xctx->save_pixmap, xctx->gc[GRIDLAYER], xctx->gridpoint, i, CoordModeOrigin);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1148,6 +1177,36 @@ static void check_cairo_drawpoints(void *cr, int layer, XPoint *points, int npoi
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
void draw_xhair_line(GC gc, int size, double linex1, double liney1, double linex2, double liney2)
|
||||
{
|
||||
int big_gr = tclgetboolvar("big_grid_points");
|
||||
char dash_arr[2];
|
||||
double x1, y1, x2, y2;
|
||||
x1=/* X_TO_SCREEN */ (linex1);
|
||||
y1=/* Y_TO_SCREEN */ (liney1);
|
||||
x2=/* X_TO_SCREEN */ (linex2);
|
||||
y2=/* Y_TO_SCREEN */ (liney2);
|
||||
if( clip(&x1,&y1,&x2,&y2) )
|
||||
{
|
||||
dash_arr[0] = dash_arr[1] = (char) 3;
|
||||
XSetDashes(display, gc, 0, dash_arr, 1);
|
||||
if(!big_gr) {
|
||||
XSetLineAttributes (display, gc,
|
||||
0, size ? LineSolid : xDashType, xCap, xJoin);
|
||||
} else {
|
||||
XSetLineAttributes (display, gc,
|
||||
size ? 0 : XLINEWIDTH(xctx->lw), size ? LineSolid : xDashType, xCap, xJoin);
|
||||
}
|
||||
if(xctx->draw_window)
|
||||
XDrawLine(display, xctx->window, gc, (int)x1, (int)y1, (int)x2, (int)y2);
|
||||
if(xctx->draw_pixmap)
|
||||
XDrawLine(display, xctx->save_pixmap, gc, (int)x1, (int)y1, (int)x2, (int)y2);
|
||||
XSetLineAttributes (display, gc,
|
||||
XLINEWIDTH(xctx->lw), LineSolid, LINECAP, LINEJOIN);
|
||||
}
|
||||
}
|
||||
|
||||
void drawline(int c, int what, double linex1, double liney1, double linex2, double liney2, int dash, void *ct)
|
||||
{
|
||||
static int i = 0;
|
||||
|
|
|
|||
|
|
@ -5081,8 +5081,16 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
else if(!strcmp(argv[2], "color_ps")) { /* set color psoscript (1 or 0) */
|
||||
color_ps=atoi(argv[3]);
|
||||
}
|
||||
else if(!strcmp(argv[2], "crosshair_layer")) { /* set layer for mouse crosshair */
|
||||
int c = atoi(argv[3]);
|
||||
tclsetintvar("crosshair_layer", c);
|
||||
xctx->crosshair_layer = c;
|
||||
if(xctx->crosshair_layer < 0 ) xctx->crosshair_layer = 2;
|
||||
if(xctx->crosshair_layer >= cadlayers ) xctx->crosshair_layer = 2;
|
||||
}
|
||||
else if(!strcmp(argv[2], "constr_mv")) { /* set constrained move (1=horiz, 2=vert, 0=none) */
|
||||
xctx->constr_mv = atoi(argv[3]);
|
||||
if(xctx->constr_mv < 0 || xctx->constr_mv > 2) xctx->constr_mv = 0;
|
||||
}
|
||||
else if(!strcmp(argv[2], "cursor1_x")) { /* set graph cursor1 position */
|
||||
xctx->graph_cursor1_x = atof_spice(argv[3]);
|
||||
|
|
|
|||
|
|
@ -2037,7 +2037,6 @@ int new_schematic(const char *what, const char *win_path, const char *fname, int
|
|||
void change_linewidth(double w)
|
||||
{
|
||||
int i, linew;
|
||||
|
||||
/* choose line width automatically based on zoom */
|
||||
dbg(1, "change_linewidth(): w = %g, win_path=%s lw=%g\n", w, xctx->current_win_path, xctx->lw);
|
||||
if(w<0. || xctx->lw == -1.0) {
|
||||
|
|
@ -2054,7 +2053,7 @@ void change_linewidth(double w)
|
|||
linew = INT_WIDTH(xctx->lw);
|
||||
dbg(1, "Line width = %d\n", linew);
|
||||
for(i=0;i<cadlayers; ++i) {
|
||||
XSetLineAttributes (display, xctx->gc[i], linew, LineSolid, LINECAP , LINEJOIN);
|
||||
XSetLineAttributes(display, xctx->gc[i], linew, LineSolid, LINECAP , LINEJOIN);
|
||||
}
|
||||
XSetLineAttributes (display, xctx->gctiled, linew, LineSolid, LINECAP , LINEJOIN);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1404,6 +1404,7 @@ extern Selected find_closest_obj(double mx,double my, int override_lock);
|
|||
extern void find_closest_net_or_symbol_pin(double mx,double my, double *x, double *y);
|
||||
|
||||
extern void drawline(int c, int what, double x1,double y1,double x2,double y2, int dash, void *ct);
|
||||
extern void draw_xhair_line(GC gc, int size, double linex1, double liney1, double linex2, double liney2);
|
||||
extern void draw_string(int layer,int what, const char *str, short rot, short flip, int hcenter, int vcenter,
|
||||
double x1, double y1, double xscale, double yscale);
|
||||
extern void get_sym_text_size(int inst, int text_n, double *xscale, double *yscale);
|
||||
|
|
|
|||
|
|
@ -7656,7 +7656,7 @@ set tctx::global_list {
|
|||
add_all_windows_drives auto_hilight auto_hilight_graph_nodes autofocus_mainwindow
|
||||
autotrim_wires orthogonal_wiring snap_cursor bespice_listen_port big_grid_points bus_replacement_char cadgrid cadlayers
|
||||
cadsnap cairo_font_name cairo_font_scale change_lw color_ps tctx::colors compare_sch constr_mv
|
||||
copy_cell crosshair_layer custom_label_prefix custom_token dark_colors dark_colorscheme
|
||||
copy_cell crosshair_layer crosshair_size custom_label_prefix custom_token dark_colors dark_colorscheme
|
||||
dark_gui_colorscheme delay_flag dim_bg dim_value disable_unique_names
|
||||
do_all_inst draw_crosshair
|
||||
draw_grid draw_grid_axes draw_window edit_prop_pos edit_prop_size
|
||||
|
|
@ -9104,6 +9104,7 @@ set_ne netlist_show 0
|
|||
set_ne color_ps 1
|
||||
set_ne ps_page_title 1 ;# add a title in the top left page corner
|
||||
set_ne crosshair_layer 3 ;# TEXTLAYER
|
||||
set_ne crosshair_size 0
|
||||
set_ne ps_paper_size {a4 842 595}
|
||||
set_ne transparent_svg 0
|
||||
set_ne only_probes 0 ; # 20110112
|
||||
|
|
|
|||
|
|
@ -282,6 +282,9 @@
|
|||
#### set crosshair layer; Default 3 (TEXTLAYER)
|
||||
# set crosshair_layer 3
|
||||
|
||||
#### set crosshair size; Default: 0 (full screen spanning crosshair)
|
||||
# set crosshair_size 5
|
||||
|
||||
#### enable to scale grid point size as done with lines at close zoom, default: 0
|
||||
# set big_grid_points 0
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue