reduce calls to find_closest_net_or_symbol_pin() in draw_crosshair()
This commit is contained in:
parent
b249a8bcdd
commit
6a869a0078
234
src/callback.c
234
src/callback.c
|
|
@ -102,7 +102,6 @@ void redraw_w_a_l_r_p_z_rubbers(int force)
|
|||
{
|
||||
double mx = xctx->mousex_snap;
|
||||
double my = xctx->mousey_snap;
|
||||
double origin_shifted_x2, origin_shifted_y2;
|
||||
|
||||
if(!force && xctx->mousex_snap == xctx->prev_rubberx && xctx->mousey_snap == xctx->prev_rubbery) return;
|
||||
|
||||
|
|
@ -110,18 +109,6 @@ void redraw_w_a_l_r_p_z_rubbers(int force)
|
|||
if(xctx->ui_state & STARTWIRE) {
|
||||
if(xctx->constr_mv == 1) my = xctx->my_double_save;
|
||||
if(xctx->constr_mv == 2) mx = xctx->mx_double_save;
|
||||
if(tclgetboolvar("orthogonal_wiring")) {
|
||||
new_wire(RUBBER|CLEAR, xctx->mousex_snap, xctx->mousey_snap);
|
||||
/* Origin shift the cartesian coordinate p2(x2,y2) w.r.t. p1(x1,y1) */
|
||||
origin_shifted_x2 = xctx->nl_x2 - xctx->nl_x1;
|
||||
origin_shifted_y2 = xctx->nl_y2 - xctx->nl_y1;
|
||||
/* Draw whichever component of the resulting orthogonal-wire is bigger (either horizontal or vertical), first */
|
||||
if(origin_shifted_x2*origin_shifted_x2 > origin_shifted_y2*origin_shifted_y2){
|
||||
xctx->manhattan_lines = 1;
|
||||
} else {
|
||||
xctx->manhattan_lines = 2;
|
||||
}
|
||||
}
|
||||
new_wire(RUBBER, mx, my);
|
||||
}
|
||||
if(xctx->ui_state & STARTARC) {
|
||||
|
|
@ -228,14 +215,10 @@ static void start_line(double mx, double my)
|
|||
|
||||
static void start_wire(double mx, double my)
|
||||
{
|
||||
dbg(1, "start_wire(): ui_state=%d, ui_state2=%d last_command=%d\n", xctx->ui_state, xctx->ui_state2, xctx->last_command);
|
||||
dbg(1, "start_wire(): ui_state=%d, ui_state2=%d last_command=%d\n",
|
||||
xctx->ui_state, xctx->ui_state2, xctx->last_command);
|
||||
xctx->last_command = STARTWIRE;
|
||||
if(xctx->ui_state & STARTWIRE) {
|
||||
if(tclgetboolvar("orthogonal_wiring") && !tclgetboolvar("constr_mv")){
|
||||
xctx->constr_mv = xctx->manhattan_lines;
|
||||
new_wire(CLEAR, mx, my);
|
||||
redraw_w_a_l_r_p_z_rubbers(1);
|
||||
}
|
||||
if(xctx->constr_mv != 2) {
|
||||
xctx->mx_double_save = mx;
|
||||
}
|
||||
|
|
@ -249,9 +232,6 @@ static void start_wire(double mx, double my)
|
|||
xctx->my_double_save=my;
|
||||
}
|
||||
new_wire(PLACE,mx, my);
|
||||
if(tclgetboolvar("orthogonal_wiring") && !tclgetboolvar("constr_mv")){
|
||||
xctx->constr_mv = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static double interpolate_yval(int idx, int p, double x, int sweep_idx, int point_not_last)
|
||||
|
|
@ -332,7 +312,7 @@ void backannotate_at_cursor_b_pos(xRect *r, Graph_ctx *gr)
|
|||
cnt = 0;
|
||||
}
|
||||
if(xx >= start && xx <= end) {
|
||||
if(dataset == sweepvar_wrap) {
|
||||
if((dataset == sweepvar_wrap)) {
|
||||
dbg(1, "xx=%g cursor2=%g first=%d last=%d start=%g end=%g p=%d wrap=%d sweepvar_wrap=%d ofs=%d\n",
|
||||
xx, cursor2, first, last, start, end, p, wrap, sweepvar_wrap, ofs);
|
||||
if(first == -1) first = p;
|
||||
|
|
@ -1375,6 +1355,7 @@ void draw_crosshair(int what, int state)
|
|||
int sdw, sdp;
|
||||
int xhair_size = tclgetintvar("crosshair_size");
|
||||
double mx, my;
|
||||
int changed = 0;
|
||||
dbg(1, "draw_crosshair(): what=%d\n", what);
|
||||
sdw = xctx->draw_window;
|
||||
sdp = xctx->draw_pixmap;
|
||||
|
|
@ -1384,9 +1365,25 @@ void draw_crosshair(int what, int state)
|
|||
my = xctx->mousey_snap;
|
||||
if( ( (xctx->ui_state & (MENUSTART | STARTWIRE) ) || xctx->ui_state == 0 ) &&
|
||||
(state == ShiftMask) ) {
|
||||
find_closest_net_or_symbol_pin(xctx->mousex, xctx->mousey, &mx, &my);
|
||||
/* mouse not changed so closest net or symbol pin unchanged too */
|
||||
if(mx == xctx->prev_m_crossx && my == xctx->prev_m_crossy) {
|
||||
mx = xctx->prev_crossx; /* get previous one */
|
||||
my = xctx->prev_crossy;
|
||||
} else {
|
||||
/* mouse position changed, so find new closest net or pin */
|
||||
find_closest_net_or_symbol_pin(xctx->mousex_snap, xctx->mousey_snap, &mx, &my);
|
||||
changed = 1; /* we force a cursor redraw */
|
||||
dbg(1, "find\n");
|
||||
}
|
||||
}
|
||||
if(!(what & 4) && mx == xctx->prev_crossx && my == xctx->prev_crossy) return;
|
||||
|
||||
/* no changed closest pin/net, no force, mx,my is not changed. --> do nothing
|
||||
| _____________| |
|
||||
| | _____________________|____________________________ */
|
||||
if(!changed && !(what & 4) && mx == xctx->prev_crossx && my == xctx->prev_crossy) {
|
||||
return;
|
||||
}
|
||||
dbg(1, "draw %d\n", what);
|
||||
xctx->draw_pixmap = 0;
|
||||
xctx->draw_window = 1;
|
||||
if(what & 1) { /* delete previous */
|
||||
|
|
@ -1479,110 +1476,21 @@ void draw_crosshair(int what, int state)
|
|||
}
|
||||
}
|
||||
if(what) draw_selection(xctx->gc[SELLAYER], 0);
|
||||
|
||||
if(what & 2) {
|
||||
/* previous closest pin or net position (if snap wire or Shift pressed) */
|
||||
xctx->prev_crossx = mx;
|
||||
xctx->prev_crossy = my;
|
||||
/* previous mouse_snap position */
|
||||
xctx->prev_m_crossx = xctx->mousex_snap;
|
||||
xctx->prev_m_crossy = xctx->mousey_snap;
|
||||
dbg(0, "update prev\n");
|
||||
}
|
||||
|
||||
xctx->draw_window = sdw;
|
||||
xctx->draw_pixmap = sdp;
|
||||
}
|
||||
|
||||
/* what == 3 : erase and draw a new cursor
|
||||
* what == 1 : erase the cursor
|
||||
* what == 2 : draw a diamond-shaped cursor that snaps to a component endpoint */
|
||||
void draw_snap_cursor(int what)
|
||||
{
|
||||
int sdw, sdp;
|
||||
int snapcursor_size = tclgetintvar("snap_cursor_size");
|
||||
int pos_changed = (xctx->mousex_snap - xctx->prev_gridx) || (xctx->mousey_snap - xctx->prev_gridy);
|
||||
double prev_x = xctx->prev_snapx;
|
||||
double prev_y = xctx->prev_snapy;
|
||||
dbg(1, "draw_snap_cursor(): 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 & 1) {
|
||||
if(fix_broken_tiled_fill || !_unix) {
|
||||
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
|
||||
(int)X_TO_SCREEN(prev_x) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size,
|
||||
(int)Y_TO_SCREEN(prev_y) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size,
|
||||
2 * INT_WIDTH(xctx->lw) + 2 * snapcursor_size,
|
||||
2 * INT_WIDTH(xctx->lw) + 2 * snapcursor_size,
|
||||
(int)X_TO_SCREEN(prev_x) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size,
|
||||
(int)Y_TO_SCREEN(prev_y) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size);
|
||||
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
|
||||
(int)X_TO_SCREEN(prev_x) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size,
|
||||
(int)Y_TO_SCREEN(prev_y) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size,
|
||||
2 * INT_WIDTH(xctx->lw) + 2 * snapcursor_size,
|
||||
2 * INT_WIDTH(xctx->lw) + 2 * snapcursor_size,
|
||||
(int)X_TO_SCREEN(prev_x) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size,
|
||||
(int)Y_TO_SCREEN(prev_y) - 1 * INT_WIDTH(xctx->lw) - snapcursor_size);
|
||||
} else {
|
||||
draw_xhair_line(xctx->gctiled, snapcursor_size,
|
||||
X_TO_SCREEN(prev_x),
|
||||
Y_TO_SCREEN(prev_y) - snapcursor_size,
|
||||
X_TO_SCREEN(prev_x) + snapcursor_size,
|
||||
Y_TO_SCREEN(prev_y));
|
||||
draw_xhair_line(xctx->gctiled, snapcursor_size,
|
||||
X_TO_SCREEN(prev_x) + snapcursor_size,
|
||||
Y_TO_SCREEN(prev_y),
|
||||
X_TO_SCREEN(prev_x),
|
||||
Y_TO_SCREEN(prev_y) + snapcursor_size);
|
||||
draw_xhair_line(xctx->gctiled, snapcursor_size,
|
||||
X_TO_SCREEN(prev_x),
|
||||
Y_TO_SCREEN(prev_y) + snapcursor_size,
|
||||
X_TO_SCREEN(prev_x) - snapcursor_size,
|
||||
Y_TO_SCREEN(prev_y));
|
||||
draw_xhair_line(xctx->gctiled, snapcursor_size,
|
||||
X_TO_SCREEN(prev_x) - snapcursor_size,
|
||||
Y_TO_SCREEN(prev_y),
|
||||
X_TO_SCREEN(prev_x),
|
||||
Y_TO_SCREEN(prev_y) - snapcursor_size);
|
||||
}
|
||||
}
|
||||
if(what & 1) {
|
||||
double x, y;
|
||||
if(!pos_changed) {
|
||||
x = xctx->prev_snapx;
|
||||
y = xctx->prev_snapy;
|
||||
} else { /* Only search for nearest pin if the grid-snap-point has changed */
|
||||
xctx->closest_pin_found = find_closest_net_or_symbol_pin(xctx->mousex, xctx->mousey, &x, &y);
|
||||
}
|
||||
draw_xhair_line(xctx->gc[xctx->crosshair_layer], snapcursor_size,
|
||||
X_TO_SCREEN(x),
|
||||
Y_TO_SCREEN(y) - snapcursor_size,
|
||||
X_TO_SCREEN(x) + snapcursor_size,
|
||||
Y_TO_SCREEN(y));
|
||||
draw_xhair_line(xctx->gc[xctx->crosshair_layer], snapcursor_size,
|
||||
X_TO_SCREEN(x) + snapcursor_size,
|
||||
Y_TO_SCREEN(y),
|
||||
X_TO_SCREEN(x),
|
||||
Y_TO_SCREEN(y) + snapcursor_size);
|
||||
draw_xhair_line(xctx->gc[xctx->crosshair_layer], snapcursor_size,
|
||||
X_TO_SCREEN(x),
|
||||
Y_TO_SCREEN(y) + snapcursor_size,
|
||||
X_TO_SCREEN(x) - snapcursor_size,
|
||||
Y_TO_SCREEN(y));
|
||||
draw_xhair_line(xctx->gc[xctx->crosshair_layer], snapcursor_size,
|
||||
X_TO_SCREEN(x) - snapcursor_size,
|
||||
Y_TO_SCREEN(y),
|
||||
X_TO_SCREEN(x),
|
||||
Y_TO_SCREEN(y) - snapcursor_size);
|
||||
xctx->prev_gridx = xctx->mousex_snap;
|
||||
xctx->prev_gridy = xctx->mousey_snap;
|
||||
xctx->prev_snapx = x;
|
||||
xctx->prev_snapy = y;
|
||||
}
|
||||
draw_selection(xctx->gc[SELLAYER], 0);
|
||||
|
||||
xctx->draw_window = sdw;
|
||||
xctx->draw_pixmap = sdp;
|
||||
}
|
||||
|
||||
/* complete the STARTWIRE, STARTRECT, STARTZOOM, STARTCOPY ... operations */
|
||||
static int end_place_move_copy_zoom()
|
||||
{
|
||||
|
|
@ -1680,7 +1588,6 @@ void snapped_wire(double c_snap)
|
|||
new_wire(PLACE|END, x, y);
|
||||
xctx->constr_mv=0;
|
||||
tcleval("set constr_mv 0" );
|
||||
if((xctx->ui_state & MENUSTART) && !tclgetboolvar("persistent_command") ) xctx->ui_state &= ~MENUSTART;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2397,10 +2304,6 @@ int enable_stretch = tclgetboolvar("enable_stretch");
|
|||
int draw_xhair = tclgetboolvar("draw_crosshair");
|
||||
int crosshair_size = tclgetintvar("crosshair_size");
|
||||
int infix_interface = tclgetboolvar("infix_interface");
|
||||
int snap_cursor = tclgetboolvar("snap_cursor");
|
||||
int wire_draw_active = (xctx->ui_state & STARTWIRE) ||
|
||||
((xctx->ui_state2 & MENUSTARTWIRE) && (xctx->ui_state & MENUSTART)) ||
|
||||
(tclgetboolvar("persistent_command") && (xctx->last_command & STARTWIRE));
|
||||
int rstate; /* (reduced state, without ShiftMask) */
|
||||
|
||||
/* this fix uses an alternative method for getting mouse coordinates on KeyPress/KeyRelease
|
||||
|
|
@ -2435,11 +2338,6 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
}
|
||||
#endif
|
||||
|
||||
if(wire_draw_active) {
|
||||
tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW WIRE! }", NULL);
|
||||
} else {
|
||||
tclvareval(xctx->top_path, ".statusbar.10 configure -state normal -text { }", NULL);
|
||||
}
|
||||
tclvareval(xctx->top_path, ".statusbar.7 configure -text $netlist_type", NULL);
|
||||
tclvareval(xctx->top_path, ".statusbar.3 delete 0 end;",
|
||||
xctx->top_path, ".statusbar.3 insert 0 $cadsnap",
|
||||
|
|
@ -2518,7 +2416,6 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
|
||||
case LeaveNotify:
|
||||
if(draw_xhair) draw_crosshair(1, state); /* clear crosshair when exiting window */
|
||||
if(snap_cursor && wire_draw_active) draw_snap_cursor(1);
|
||||
tclvareval(xctx->top_path, ".drw configure -cursor {}" , NULL);
|
||||
xctx->mouse_inside = 0;
|
||||
break;
|
||||
|
|
@ -2589,7 +2486,6 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
if(draw_xhair) {
|
||||
draw_crosshair(1, state); /* when moving mouse: first action is delete crosshair, will be drawn later */
|
||||
}
|
||||
if(snap_cursor && wire_draw_active) draw_snap_cursor(1);
|
||||
/* pan schematic */
|
||||
if(xctx->ui_state & STARTPAN) pan(RUBBER, mx, my);
|
||||
|
||||
|
|
@ -2597,7 +2493,6 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
if(draw_xhair) {
|
||||
draw_crosshair(2, state); /* locked UI: draw new crosshair and break out */
|
||||
}
|
||||
if(snap_cursor && wire_draw_active) draw_snap_cursor(2);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -2697,7 +2592,6 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
if(draw_xhair) {
|
||||
draw_crosshair(2, state); /* what = 2(draw) */
|
||||
}
|
||||
if(snap_cursor && wire_draw_active) draw_snap_cursor(2);
|
||||
break;
|
||||
|
||||
case KeyRelease:
|
||||
|
|
@ -2938,15 +2832,21 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
hilight_net_pin_mismatches();
|
||||
break;
|
||||
}
|
||||
if(key== 's' /* && !xctx->ui_state */ && rstate == 0) { /* create wire snapping to closest instance pin */
|
||||
if(key== 'W' /* && !xctx->ui_state */ && rstate == 0) { /* create wire snapping to closest instance pin */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
snapped_wire(c_snap);
|
||||
if(infix_interface) {
|
||||
snapped_wire(c_snap);
|
||||
} else {
|
||||
xctx->ui_state |= MENUSTART;
|
||||
xctx->ui_state2 = MENUSTARTSNAPWIRE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(key == 'w' /* && !xctx->ui_state */ && rstate==0) /* place wire. */
|
||||
{
|
||||
int prev_state = xctx->ui_state;
|
||||
if(xctx->semaphore >= 2) break;
|
||||
|
||||
if(infix_interface) {
|
||||
start_wire(xctx->mousex_snap, xctx->mousey_snap);
|
||||
if(prev_state == STARTWIRE) {
|
||||
|
|
@ -2957,7 +2857,6 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
xctx->last_command = 0;
|
||||
xctx->ui_state |= MENUSTART;
|
||||
xctx->ui_state2 = MENUSTARTWIRE;
|
||||
if(prev_state & STARTWIRE) start_wire(xctx->mousex_snap, xctx->mousey_snap);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -2972,13 +2871,6 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
}
|
||||
/* stuff that can be done reentrantly ... */
|
||||
tclsetvar("tclstop", "1"); /* stop simulation if any running */
|
||||
if(xctx->ui_state2 & MENUSTARTWIRE) {
|
||||
xctx->ui_state2 &= ~MENUSTARTWIRE;
|
||||
}
|
||||
if(tclgetboolvar("persistent_command") && (xctx->last_command & STARTWIRE)) {
|
||||
xctx->last_command &= ~STARTWIRE;
|
||||
if(snap_cursor) draw_snap_cursor(1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(key=='z' && rstate == 0 &&
|
||||
|
|
@ -2991,16 +2883,6 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
{
|
||||
view_zoom(0.0); break;
|
||||
}
|
||||
if(key=='z' && EQUAL_MODMASK) /* toggle snap-cursor option */
|
||||
{
|
||||
if(tclgetboolvar("snap_cursor")) {
|
||||
tclsetvar("snap_cursor", "0");
|
||||
draw_snap_cursor(1);
|
||||
} else {
|
||||
tclsetvar("snap_cursor", "1");
|
||||
if(wire_draw_active) draw_snap_cursor(3);
|
||||
}
|
||||
}
|
||||
if(key=='p' && EQUAL_MODMASK) /* add symbol pin */
|
||||
{
|
||||
xctx->push_undo();
|
||||
|
|
@ -3193,7 +3075,7 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
draw(); /* needed to ungrey or grey out components due to *_ignore attribute */
|
||||
break;
|
||||
}
|
||||
if(key=='r' && rstate == ControlMask ) /* simulate */
|
||||
if(key=='s' && rstate == 0 ) /* simulate */
|
||||
{
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(waves_selected(event, key, state, button)) {
|
||||
|
|
@ -3705,16 +3587,6 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
place_net_label(0);
|
||||
break;
|
||||
}
|
||||
if(key=='L' && rstate == 0) { /* toggle orthogonal routing */
|
||||
if(tclgetboolvar("orthogonal_wiring")){
|
||||
tclsetboolvar("orthogonal_wiring", 0);
|
||||
xctx->manhattan_lines = 0;
|
||||
} else {
|
||||
tclsetboolvar("orthogonal_wiring", 1);
|
||||
}
|
||||
redraw_w_a_l_r_p_z_rubbers(1);
|
||||
break;
|
||||
}
|
||||
if(key=='F' && rstate == 0) /* flip */
|
||||
{
|
||||
if(xctx->ui_state & STARTMOVE) move_objects(FLIP,0,0,0);
|
||||
|
|
@ -4290,18 +4162,7 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
/* start another wire or line in persistent mode */
|
||||
if(tclgetboolvar("persistent_command") && xctx->last_command) {
|
||||
if(xctx->last_command == STARTLINE) start_line(xctx->mousex_snap, xctx->mousey_snap);
|
||||
if(xctx->last_command == STARTWIRE){
|
||||
if(tclgetboolvar("snap_cursor")
|
||||
&& (xctx->prev_snapx == xctx->mousex_snap
|
||||
&& xctx->prev_snapy == xctx->mousey_snap)
|
||||
&& (xctx->ui_state & STARTWIRE)
|
||||
&& xctx->closest_pin_found){
|
||||
new_wire(PLACE|END, xctx->mousex_snap, xctx->mousey_snap);
|
||||
xctx->ui_state &= ~STARTWIRE;
|
||||
}
|
||||
else
|
||||
start_wire(xctx->mousex_snap, xctx->mousey_snap);
|
||||
}
|
||||
if(xctx->last_command == STARTWIRE) start_wire(xctx->mousex_snap, xctx->mousey_snap);
|
||||
break;
|
||||
}
|
||||
/* handle all object insertions started from Tools/Edit menu */
|
||||
|
|
@ -4338,7 +4199,7 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
|
||||
/* find closest object. Use snap coordinates if full crosshair is enabled
|
||||
* since the mouse pointer is obscured and crosshair is snapped to grid points */
|
||||
if(draw_xhair) {
|
||||
if(draw_xhair && crosshair_size == 0) {
|
||||
sel = find_closest_obj(xctx->mousex_snap, xctx->mousey_snap, 0);
|
||||
} else {
|
||||
sel = find_closest_obj(xctx->mousex, xctx->mousey, 0);
|
||||
|
|
@ -4473,12 +4334,12 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
xctx->semaphore = savesem;
|
||||
}
|
||||
|
||||
/* end wire creation when dragging in intuitive interface from an inst pin ow wire endpoint */
|
||||
/*else if(state == Button1Mask && xctx->intuitive_interface
|
||||
* && (xctx->ui_state & STARTWIRE) && !(xctx->ui_state & MENUSTART)) {*/
|
||||
/* if(end_place_move_copy_zoom()) break;*/
|
||||
/*}*/
|
||||
|
||||
/* end wire creation when dragging in intuitive interface from an inst pin or wire endpoint */
|
||||
else if(state == Button1Mask && xctx->intuitive_interface &&
|
||||
(xctx->ui_state & STARTWIRE) && !(xctx->ui_state & MENUSTART)) {
|
||||
if(end_place_move_copy_zoom()) break;
|
||||
}
|
||||
|
||||
/* end intuitive_interface copy or move */
|
||||
if(xctx->ui_state & STARTCOPY && xctx->drag_elements) {
|
||||
copy_objects(END);
|
||||
|
|
@ -4523,14 +4384,13 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
xctx->mousex_snap, xctx->mousey_snap, xctx->lastsel, xctx->sch_path[xctx->currsch] );
|
||||
statusmsg(str,1);
|
||||
}
|
||||
|
||||
|
||||
/* clear start from menu flag or infix_interface=0 start commands */
|
||||
if(xctx->ui_state & MENUSTART) {
|
||||
xctx->ui_state &= ~MENUSTART;
|
||||
break;
|
||||
}
|
||||
if(draw_xhair) draw_crosshair(3, state); /* restore crosshair when selecting / unselecting */
|
||||
if(snap_cursor && wire_draw_active) draw_snap_cursor(3);
|
||||
break;
|
||||
case -3: /* double click : edit prop */
|
||||
if( waves_selected(event, key, state, button)) {
|
||||
|
|
@ -4554,8 +4414,6 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
edit_property(0);
|
||||
} else {
|
||||
if(xctx->ui_state & STARTWIRE) {
|
||||
redraw_w_a_l_r_p_z_rubbers(1);
|
||||
start_wire(mx, my);
|
||||
xctx->ui_state &= ~STARTWIRE;
|
||||
}
|
||||
if(xctx->ui_state & STARTLINE) {
|
||||
|
|
|
|||
|
|
@ -646,10 +646,8 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
|
|||
xctx->enable_drill = 0;
|
||||
xctx->prev_set_modify = -1;
|
||||
xctx->prev_crossx = xctx->prev_crossy = 0.0;
|
||||
xctx->prev_m_crossx = xctx->prev_m_crossy = 0.0;
|
||||
xctx->prev_rubberx = xctx->prev_rubbery = 0.0;
|
||||
xctx->prev_gridx = xctx->prev_gridy = 0.0;
|
||||
xctx->prev_snapx = xctx->prev_snapy = 0.0;
|
||||
xctx->closest_pin_found = 0;
|
||||
xctx->mouse_inside = 0;
|
||||
xctx->pending_fullzoom = 0;
|
||||
my_strncpy(xctx->hiersep, ".", S(xctx->hiersep));
|
||||
|
|
|
|||
|
|
@ -1050,10 +1050,8 @@ typedef struct {
|
|||
double xpan,ypan,xpan2,ypan2;
|
||||
double p_xx1,p_xx2,p_yy1,p_yy2;
|
||||
/* draw_crosshair */
|
||||
double prev_crossx, prev_crossy;
|
||||
double prev_gridx, prev_gridy;
|
||||
double prev_snapx, prev_snapy;
|
||||
int closest_pin_found;
|
||||
double prev_crossx, prev_crossy; /* previous closest net/pin found by draw_crosshair() */
|
||||
double prev_m_crossx, prev_m_crossy; /* previous snap mouse position processed by draw_crosshair() */
|
||||
int mouse_inside;
|
||||
/* set_modify */
|
||||
int prev_set_modify;
|
||||
|
|
@ -1395,7 +1393,6 @@ extern void tclmainloop(void);
|
|||
extern int Tcl_AppInit(Tcl_Interp *interp);
|
||||
extern void abort_operation(void);
|
||||
extern void draw_crosshair(int what, int state);
|
||||
extern void draw_snap_cursor(int what);
|
||||
extern void backannotate_at_cursor_b_pos(xRect *r, Graph_ctx *gr);
|
||||
/* extern void snapped_wire(double c_snap); */
|
||||
extern int callback(const char *winpath, int event, int mx, int my, KeySym key,
|
||||
|
|
|
|||
|
|
@ -7661,9 +7661,9 @@ set tctx::global_list {
|
|||
PDK_ROOT PDK SKYWATER_MODELS SKYWATER_STDCELLS
|
||||
INITIALINSTDIR INITIALLOADDIR INITIALPROPDIR INITIALTEXTDIR XSCHEM_LIBRARY_PATH
|
||||
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
|
||||
autotrim_wires 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 crosshair_size cursor_2_hook snap_cursor_size custom_label_prefix custom_token
|
||||
copy_cell crosshair_layer crosshair_size cursor_2_hook 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
|
||||
|
|
@ -7980,7 +7980,6 @@ proc pack_widgets { { topwin {} } } {
|
|||
pack $topwin.statusbar.6 -side left
|
||||
pack $topwin.statusbar.7 -side left
|
||||
pack $topwin.statusbar.10 -side left
|
||||
pack $topwin.statusbar.11 -side left
|
||||
pack $topwin.statusbar.9 -side left
|
||||
pack $topwin.statusbar.8 -side left
|
||||
pack $topwin.statusbar.1 -side left -fill x
|
||||
|
|
@ -8081,8 +8080,8 @@ proc build_widgets { {topwin {} } } {
|
|||
global recentfile color_ps transparent_svg menu_debug_var enable_stretch
|
||||
global netlist_show flat_netlist split_files compare_sch intuitive_interface
|
||||
global draw_grid big_grid_points sym_txt change_lw incr_hilight symbol_width
|
||||
global cadsnap cadgrid draw_window toolbar_visible hide_symbols undo_type snap_cursor
|
||||
global disable_unique_names persistent_command autotrim_wires infix_interface orthogonal_wiring en_hilight_conn_inst
|
||||
global cadsnap cadgrid draw_window toolbar_visible hide_symbols undo_type
|
||||
global disable_unique_names persistent_command autotrim_wires en_hilight_conn_inst
|
||||
global local_netlist_dir editor netlist_type netlist_dir spiceprefix initial_geometry
|
||||
if { $dark_gui_colorscheme} {
|
||||
set selectcolor white
|
||||
|
|
@ -8205,10 +8204,6 @@ proc build_widgets { {topwin {} } } {
|
|||
-onvalue disk -offvalue memory -command {switch_undo}
|
||||
$topwin.menubar.option add checkbutton -label "Enable stretch" -variable enable_stretch \
|
||||
-selectcolor $selectcolor -accelerator Y
|
||||
$topwin.menubar.option add checkbutton -label "Enable infix-interface" -variable infix_interface \
|
||||
-selectcolor $selectcolor
|
||||
$topwin.menubar.option add checkbutton -label "Enable orthogonal wiring" -variable orthogonal_wiring \
|
||||
-selectcolor $selectcolor -accelerator Shift-L
|
||||
$topwin.menubar.option add checkbutton -label "Unsel. partial sel. wires after stretch move" \
|
||||
-selectcolor $selectcolor -variable unselect_partial_sel_wires
|
||||
|
||||
|
|
@ -8227,8 +8222,6 @@ proc build_widgets { {topwin {} } } {
|
|||
|
||||
$topwin.menubar.option add checkbutton -label "Draw crosshair" \
|
||||
-variable draw_crosshair -selectcolor $selectcolor -accelerator {Alt-X}
|
||||
$topwin.menubar.option add checkbutton -label "Draw persistent snap cursor" -variable snap_cursor \
|
||||
-selectcolor $selectcolor -accelerator {Alt-Z}
|
||||
|
||||
$topwin.menubar.option add command -label "Replace \[ and \] for buses in SPICE netlist" \
|
||||
-command {
|
||||
|
|
@ -8727,8 +8720,7 @@ tclcommand=\"xschem raw_read \$netlist_dir/[file tail [file rootname [xschem get
|
|||
entry_replace_selection $topwin.statusbar.5
|
||||
label $topwin.statusbar.6 -text "MODE:"
|
||||
label $topwin.statusbar.7 -width 7
|
||||
label $topwin.statusbar.11 -text {Stretch:}
|
||||
label $topwin.statusbar.10 -activebackground green -text {}
|
||||
label $topwin.statusbar.10 -text {Stretch:}
|
||||
label $topwin.statusbar.9 -textvariable enable_stretch
|
||||
label $topwin.statusbar.8 -activebackground red -text {}
|
||||
add_toolbuttons $topwin
|
||||
|
|
@ -9113,7 +9105,6 @@ set_ne ps_page_title 1 ;# add a title in the top left page corner
|
|||
set_ne draw_crosshair 0
|
||||
set_ne crosshair_layer 8 ;# Yellow
|
||||
set_ne crosshair_size 0
|
||||
set_ne snap_cursor_size 6
|
||||
set_ne ps_paper_size {a4 842 595}
|
||||
set_ne transparent_svg 0
|
||||
set_ne only_probes 0 ; # 20110112
|
||||
|
|
@ -9143,10 +9134,8 @@ set_ne big_grid_points 0
|
|||
set_ne draw_grid_axes 1
|
||||
set_ne persistent_command 0
|
||||
set_ne intuitive_interface 1
|
||||
set_ne infix_interface 1
|
||||
set_ne autotrim_wires 0
|
||||
set_ne infix_interface 0
|
||||
set_ne snap_cursor 0
|
||||
set_ne orthogonal_wiring 1
|
||||
set_ne compare_sch 0
|
||||
set_ne disable_unique_names 0
|
||||
set_ne sym_txt 1
|
||||
|
|
|
|||
20
src/xschemrc
20
src/xschemrc
|
|
@ -226,18 +226,6 @@
|
|||
#### if not set show selected items at end of drag. Default: enabled (1)
|
||||
# set incremental_select 0
|
||||
|
||||
#### if set to 1, pressing 'w', 'l', 'r', 'C', or 'Ctrl+C' will immediately place the
|
||||
#### corresponding component at current cursor position without waiting for Button1 (LMB) click.
|
||||
#### This setting can be disabled via the Options menu
|
||||
#### default: 0
|
||||
# set infix_interface 1
|
||||
|
||||
#### wires are drawn in free-form mode with this mode enabled (default).
|
||||
#### if set to 0, wires drawn on the schematic will no longer strictly
|
||||
#### follow orthogonal routes to connect two distinct points together.
|
||||
#### default: 1
|
||||
# set orthogonal_wiring 0
|
||||
|
||||
#### if set to 1 automatically join/trim wires while editing
|
||||
#### this may slow down on rally big designs. Can be disabled via menu
|
||||
#### default: 0
|
||||
|
|
@ -283,13 +271,7 @@
|
|||
# set crosshair_layer 8
|
||||
|
||||
#### set crosshair size; Default: 0 (full screen spanning crosshair)
|
||||
set crosshair_size 2
|
||||
|
||||
#### enable drawing a diamond-shaped cursor at the closest circuit endpoint. Default: disabled (0)
|
||||
# set snap_cursor 1
|
||||
|
||||
#### set snap_cursor_size; Default: 6 (Diamond-shaped cursor that snaps to nearest circuit endpoint)
|
||||
# set snap_cursor_size 6
|
||||
# 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