Merge remote-tracking branch 'supercd/master' into SuperChayan
This commit is contained in:
commit
10f04fe30c
|
|
@ -3079,7 +3079,7 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
if( (xctx->ui_state & STARTWIRE) && (xctx->nl_x1!=xctx->nl_x2 || xctx->nl_y1!=xctx->nl_y2) ) {
|
||||
xctx->push_undo();
|
||||
if(xctx->manhattan_lines & 1) {
|
||||
if(xctx->nl_xx2!=xctx->nl_xx1) {
|
||||
if(xctx->nl_x2!=xctx->nl_x1) {
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1);
|
||||
|
|
@ -3088,7 +3088,7 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
hash_wire(XINSERT, xctx->wires-1, 1);
|
||||
drawline(WIRELAYER,NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1, 0, NULL);
|
||||
}
|
||||
if(xctx->nl_yy2!=xctx->nl_yy1) {
|
||||
if(xctx->nl_y2!=xctx->nl_y1) {
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
|
|
@ -3098,7 +3098,7 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
drawline(WIRELAYER,NOW, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2, 0, NULL);
|
||||
}
|
||||
} else if(xctx->manhattan_lines & 2) {
|
||||
if(xctx->nl_yy2!=xctx->nl_yy1) {
|
||||
if(xctx->nl_y2!=xctx->nl_y1) {
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2);
|
||||
|
|
@ -3107,7 +3107,7 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
hash_wire(XINSERT, xctx->wires-1, 1);
|
||||
drawline(WIRELAYER,NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2, 0, NULL);
|
||||
}
|
||||
if(xctx->nl_xx2!=xctx->nl_xx1) {
|
||||
if(xctx->nl_x2!=xctx->nl_x1) {
|
||||
xctx->nl_xx1=xctx->nl_x1;xctx->nl_yy1=xctx->nl_y1;
|
||||
xctx->nl_xx2=xctx->nl_x2;xctx->nl_yy2=xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2);
|
||||
|
|
@ -3183,11 +3183,11 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
xctx->ui_state &= ~STARTWIRE;
|
||||
}
|
||||
if( (what & RUBBER) ) {
|
||||
drawtemp_manhattanline(xctx->gctiled, NOW, xctx->nl_x1, xctx->nl_y1, xctx->nl_x2, xctx->nl_y2);
|
||||
drawtemp_manhattanline(xctx->gctiled, NOW, xctx->nl_x1, xctx->nl_y1, xctx->nl_x2, xctx->nl_y2, 0);
|
||||
restore_selection(xctx->nl_x1, xctx->nl_y1, xctx->nl_x2, xctx->nl_y2);
|
||||
xctx->nl_x2 = mx_snap; xctx->nl_y2 = my_snap;
|
||||
if(!(what & CLEAR)) {
|
||||
drawtemp_manhattanline(xctx->gc[WIRELAYER], NOW, xctx->nl_x1, xctx->nl_y1, xctx->nl_x2, xctx->nl_y2);
|
||||
drawtemp_manhattanline(xctx->gc[WIRELAYER], NOW, xctx->nl_x1, xctx->nl_y1, xctx->nl_x2, xctx->nl_y2, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ void abort_operation(void)
|
|||
return;
|
||||
}
|
||||
xctx->last_command=0;
|
||||
xctx->manhattan_lines = 0;
|
||||
/* xctx->manhattan_lines = 0; */
|
||||
if(xctx->ui_state & STARTMOVE)
|
||||
{
|
||||
move_objects(ABORT,0,0,0);
|
||||
|
|
@ -226,7 +226,7 @@ void start_line(double mx, double my)
|
|||
if(xctx->constr_mv == 1) my = xctx->my_double_save;
|
||||
if(xctx->constr_mv == 2) mx = xctx->mx_double_save;
|
||||
} else {
|
||||
xctx->manhattan_lines = 0;
|
||||
/* xctx->manhattan_lines = 0; */
|
||||
xctx->mx_double_save=mx;
|
||||
xctx->my_double_save=my;
|
||||
}
|
||||
|
|
@ -253,6 +253,7 @@ void start_wire(double mx, double my)
|
|||
if(xctx->constr_mv == 1) my = xctx->my_double_save;
|
||||
if(xctx->constr_mv == 2) mx = xctx->mx_double_save;
|
||||
} else {
|
||||
/* xctx->manhattan_lines = 1; */
|
||||
xctx->mx_double_save=mx;
|
||||
xctx->my_double_save=my;
|
||||
}
|
||||
|
|
@ -1672,7 +1673,7 @@ static void snapped_wire(double c_snap)
|
|||
find_closest_net_or_symbol_pin(xctx->mousex, xctx->mousey, &x, &y);
|
||||
xctx->mx_double_save = my_round(x / c_snap) * c_snap;
|
||||
xctx->my_double_save = my_round(y / c_snap) * c_snap;
|
||||
xctx->manhattan_lines = 1;
|
||||
/* xctx->manhattan_lines = 1; */
|
||||
new_wire(PLACE, x, y);
|
||||
new_wire(RUBBER, xctx->mousex_snap,xctx->mousey_snap);
|
||||
}
|
||||
|
|
@ -4542,9 +4543,23 @@ int infix_interface = tclgetboolvar("infix_interface");
|
|||
int rstate; /* (reduced state, without ShiftMask) */
|
||||
int snap_cursor = tclgetboolvar("snap_cursor");
|
||||
int cadence_compat = tclgetboolvar("cadence_compat");
|
||||
int persistent_command = tclgetboolvar("persistent_command");
|
||||
|
||||
int wire_draw_active = (xctx->ui_state & STARTWIRE) ||
|
||||
((xctx->ui_state2 & MENUSTARTWIRE) && (xctx->ui_state & MENUSTART)) ||
|
||||
(tclgetboolvar("persistent_command") && (xctx->last_command & STARTWIRE));
|
||||
(persistent_command && (xctx->last_command & STARTWIRE));
|
||||
int line_draw_active = (xctx->ui_state & STARTLINE) ||
|
||||
((xctx->ui_state2 & MENUSTARTLINE) && (xctx->ui_state & MENUSTART)) ||
|
||||
(persistent_command && (xctx->last_command & STARTLINE));
|
||||
int poly_draw_active = (xctx->ui_state & STARTPOLYGON) ||
|
||||
((xctx->ui_state2 & MENUSTARTPOLYGON) && (xctx->ui_state & MENUSTART)) ||
|
||||
(persistent_command && (xctx->last_command & STARTPOLYGON));
|
||||
int arc_draw_active = (xctx->ui_state & STARTARC) ||
|
||||
((xctx->ui_state2 & MENUSTARTARC) && (xctx->ui_state & MENUSTART)) ||
|
||||
(persistent_command && (xctx->last_command & STARTARC));
|
||||
int rect_draw_active = (xctx->ui_state & STARTRECT) ||
|
||||
((xctx->ui_state2 & MENUSTARTRECT) && (xctx->ui_state & MENUSTART)) ||
|
||||
(persistent_command && (xctx->last_command & STARTRECT));
|
||||
|
||||
/* this fix uses an alternative method for getting mouse coordinates on KeyPress/KeyRelease
|
||||
* events. Some remote connection softwares do not generate the correct coordinates
|
||||
|
|
@ -4580,6 +4595,14 @@ int wire_draw_active = (xctx->ui_state & STARTWIRE) ||
|
|||
|
||||
if(wire_draw_active) {
|
||||
tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW WIRE! }", NULL);
|
||||
} else if(line_draw_active) {
|
||||
tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW LINE! }", NULL);
|
||||
} else if(poly_draw_active) {
|
||||
tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW POLYGON! }", NULL);
|
||||
} else if(arc_draw_active) {
|
||||
tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW ARC! }", NULL);
|
||||
} else if(rect_draw_active) {
|
||||
tclvareval(xctx->top_path, ".statusbar.10 configure -state active -text {DRAW RECTANGLE! }", NULL);
|
||||
} else {
|
||||
tclvareval(xctx->top_path, ".statusbar.10 configure -state normal -text { }", NULL);
|
||||
}
|
||||
|
|
|
|||
45
src/draw.c
45
src/draw.c
|
|
@ -1375,10 +1375,11 @@ void drawtempline(GC gc, int what, double linex1,double liney1,double linex2,dou
|
|||
}
|
||||
}
|
||||
|
||||
void drawtemp_manhattanline(GC gc, int what, double x1, double y1, double x2, double y2)
|
||||
void drawtemp_manhattanline(GC gc, int what, double x1, double y1, double x2, double y2, int force_manhattan)
|
||||
{
|
||||
double nl_xx1, nl_yy1, nl_xx2, nl_yy2;
|
||||
double origin_shifted_x2, origin_shifted_y2;
|
||||
if(tclgetboolvar("orthogonal_wiring")) {
|
||||
if(tclgetboolvar("orthogonal_wiring") && force_manhattan) {
|
||||
/* Origin shift the cartesian coordinate p2(x2,y2) w.r.t. p1(x1,y1) */
|
||||
origin_shifted_x2 = x2 - x1;
|
||||
origin_shifted_y2 = y2 - y1;
|
||||
|
|
@ -1389,28 +1390,28 @@ void drawtemp_manhattanline(GC gc, int what, double x1, double y1, double x2, do
|
|||
xctx->manhattan_lines = 2;
|
||||
}
|
||||
if(xctx->manhattan_lines & 1) {
|
||||
xctx->nl_xx1 = x1; xctx->nl_yy1 = y1;
|
||||
xctx->nl_xx2 = x2; xctx->nl_yy2 = y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1);
|
||||
drawtempline(gc, what, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1);
|
||||
xctx->nl_xx1 = x1; xctx->nl_yy1 = y1;
|
||||
xctx->nl_xx2 = x2; xctx->nl_yy2 = y2;
|
||||
ORDER(xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
drawtempline(gc, what, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
nl_xx1 = x1; nl_yy1 = y1;
|
||||
nl_xx2 = x2; nl_yy2 = y2;
|
||||
ORDER(nl_xx1,nl_yy1,nl_xx2,nl_yy1);
|
||||
drawtempline(gc, what, nl_xx1,nl_yy1,nl_xx2,nl_yy1);
|
||||
nl_xx1 = x1; nl_yy1 = y1;
|
||||
nl_xx2 = x2; nl_yy2 = y2;
|
||||
ORDER(nl_xx2,nl_yy1,nl_xx2,nl_yy2);
|
||||
drawtempline(gc, what, nl_xx2,nl_yy1,nl_xx2,nl_yy2);
|
||||
} else if(xctx->manhattan_lines & 2) {
|
||||
xctx->nl_xx1 = x1; xctx->nl_yy1 = y1;
|
||||
xctx->nl_xx2 = x2; xctx->nl_yy2 = y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2);
|
||||
drawtempline(gc, what, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2);
|
||||
xctx->nl_xx1 = x1; xctx->nl_yy1 = y1;
|
||||
xctx->nl_xx2 = x2; xctx->nl_yy2 = y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2);
|
||||
drawtempline(gc, what, xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2);
|
||||
nl_xx1 = x1; nl_yy1 = y1;
|
||||
nl_xx2 = x2; nl_yy2 = y2;
|
||||
ORDER(nl_xx1,nl_yy1,nl_xx1,nl_yy2);
|
||||
drawtempline(gc, what, nl_xx1,nl_yy1,nl_xx1,nl_yy2);
|
||||
nl_xx1 = x1; nl_yy1 = y1;
|
||||
nl_xx2 = x2; nl_yy2 = y2;
|
||||
ORDER(nl_xx1,nl_yy2,nl_xx2,nl_yy2);
|
||||
drawtempline(gc, what, nl_xx1,nl_yy2,nl_xx2,nl_yy2);
|
||||
} else {
|
||||
xctx->nl_xx1 = x1; xctx->nl_yy1 = y1;
|
||||
xctx->nl_xx2 = x2; xctx->nl_yy2 = y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
drawtempline(gc, what, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
nl_xx1 = x1; nl_yy1 = y1;
|
||||
nl_xx2 = x2; nl_yy2 = y2;
|
||||
ORDER(nl_xx1,nl_yy1,nl_xx2,nl_yy2);
|
||||
drawtempline(gc, what, nl_xx1,nl_yy1,nl_xx2,nl_yy2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
12
src/move.c
12
src/move.c
|
|
@ -379,24 +379,24 @@ void draw_selection(GC g, int interruptable)
|
|||
{
|
||||
if(xctx->wire[n].bus)
|
||||
drawtemp_manhattanline(g, THICK, xctx->rx1+xctx->deltax, xctx->ry1+xctx->deltay,
|
||||
xctx->rx2+xctx->deltax, xctx->ry2+xctx->deltay);
|
||||
xctx->rx2+xctx->deltax, xctx->ry2+xctx->deltay, 1);
|
||||
else
|
||||
drawtemp_manhattanline(g, ADD, xctx->rx1+xctx->deltax, xctx->ry1+xctx->deltay,
|
||||
xctx->rx2+xctx->deltax, xctx->ry2+xctx->deltay);
|
||||
xctx->rx2+xctx->deltax, xctx->ry2+xctx->deltay, 1);
|
||||
}
|
||||
else if(xctx->wire[n].sel==SELECTED1)
|
||||
{
|
||||
if(xctx->wire[n].bus)
|
||||
drawtemp_manhattanline(g, THICK, xctx->rx1+xctx->deltax, xctx->ry1+xctx->deltay, xctx->rx2, xctx->ry2);
|
||||
drawtemp_manhattanline(g, THICK, xctx->rx1+xctx->deltax, xctx->ry1+xctx->deltay, xctx->rx2, xctx->ry2, 1);
|
||||
else
|
||||
drawtemp_manhattanline(g, ADD, xctx->rx1+xctx->deltax, xctx->ry1+xctx->deltay, xctx->rx2, xctx->ry2);
|
||||
drawtemp_manhattanline(g, ADD, xctx->rx1+xctx->deltax, xctx->ry1+xctx->deltay, xctx->rx2, xctx->ry2, 1);
|
||||
}
|
||||
else if(xctx->wire[n].sel==SELECTED2)
|
||||
{
|
||||
if(xctx->wire[n].bus)
|
||||
drawtemp_manhattanline(g, THICK, xctx->rx1, xctx->ry1, xctx->rx2+xctx->deltax, xctx->ry2+xctx->deltay);
|
||||
drawtemp_manhattanline(g, THICK, xctx->rx1, xctx->ry1, xctx->rx2+xctx->deltax, xctx->ry2+xctx->deltay, 1);
|
||||
else
|
||||
drawtemp_manhattanline(g, ADD, xctx->rx1, xctx->ry1, xctx->rx2+xctx->deltax, xctx->ry2+xctx->deltay);
|
||||
drawtemp_manhattanline(g, ADD, xctx->rx1, xctx->ry1, xctx->rx2+xctx->deltax, xctx->ry2+xctx->deltay, 1);
|
||||
}
|
||||
break;
|
||||
case LINE:
|
||||
|
|
|
|||
|
|
@ -1428,7 +1428,7 @@ extern void filledrect(int c, int what, double rectx1,double recty1,
|
|||
|
||||
|
||||
extern void drawtempline(GC gc, int what, double x1,double y1,double x2,double y2);
|
||||
extern void drawtemp_manhattanline(GC gc, int what, double x1,double y1,double x2,double y2);
|
||||
extern void drawtemp_manhattanline(GC gc, int what, double x1,double y1,double x2,double y2, int force_manhattan);
|
||||
|
||||
/* instead of doing a drawtemprect(xctx->gctiled, NOW, ....) do 4
|
||||
* XCopy Area operations. Used if fix_broken_tiled_fill is set */
|
||||
|
|
|
|||
|
|
@ -4881,22 +4881,23 @@ proc insert_symbol_preview {} {
|
|||
#### fill list of files matching pattern
|
||||
proc insert_symbol_filelist {paths {maxdepth -1}} {
|
||||
global insert_symbol new_symbol_browser_ext
|
||||
set paths [.ins.center.leftdir.l curselection]
|
||||
if {$paths eq {}} {return}
|
||||
set insert_symbol(dirindex) $paths
|
||||
set sel [.ins.center.leftdir.l curselection]
|
||||
if {![info exists insert_symbol(dirs)]} {return}
|
||||
if {$sel eq {}} {
|
||||
set sel [.ins.center.leftdir.l index active]
|
||||
.ins.center.leftdir.l selection set active
|
||||
}
|
||||
set insert_symbol(dirindex) $sel
|
||||
# puts "set dirindex=$paths"
|
||||
set paths [lindex $insert_symbol(dirs) $paths]
|
||||
set paths [lindex $insert_symbol(dirs) $sel]
|
||||
# puts "insert_symbol_filelist: paths=$paths"
|
||||
|
||||
.ins.top2.dir_e configure -state normal
|
||||
.ins.top2.dir_e delete 0 end
|
||||
.ins.top2.dir_e insert 0 $paths
|
||||
.ins.top2.dir_e configure -state readonly
|
||||
|
||||
#check if regex is valid
|
||||
set err [catch {regexp $insert_symbol(regex) {12345}} res]
|
||||
if {$err} {return}
|
||||
|
||||
set f [match_file $insert_symbol(regex) $paths 0]
|
||||
set filelist {}
|
||||
set insert_symbol(fullpathlist) {}
|
||||
|
|
@ -4908,7 +4909,6 @@ proc insert_symbol_filelist {paths {maxdepth -1}} {
|
|||
if {$sel eq {}} { set sel 0}
|
||||
.ins.center.left.l activate $sel
|
||||
foreach i $f {
|
||||
|
||||
set err [catch {regexp $new_symbol_browser_ext $i} type]
|
||||
if {!$err && $type} {
|
||||
set fname [file tail $i]
|
||||
|
|
@ -4924,13 +4924,11 @@ proc insert_symbol_filelist {paths {maxdepth -1}} {
|
|||
set files [lsort -dictionary -index 0 $files]
|
||||
set filelist {}
|
||||
set insert_symbol(fullpathlist) {}
|
||||
|
||||
foreach f $files {
|
||||
lassign $f ff fff
|
||||
lappend filelist $ff
|
||||
lappend insert_symbol(fullpathlist) $fff
|
||||
}
|
||||
|
||||
set insert_symbol(nitems) [llength $filelist]
|
||||
# assign listbox variable all at the end, it is faster...
|
||||
set insert_symbol(list) $filelist
|
||||
|
|
@ -5026,6 +5024,10 @@ proc insert_symbol {{paths {}} {maxdepth -1} {ext {.*}}} {
|
|||
"
|
||||
bind .ins.center.leftdir.l <<ListboxSelect>> "insert_symbol_filelist [list $paths] [list $maxdepth]"
|
||||
bind .ins.center.left.l <<ListboxSelect>> "insert_symbol_preview"
|
||||
bind .ins.center.left.l <KeyPress-Return> "
|
||||
xschem preview_window close .ins.center.right {}
|
||||
destroy .ins
|
||||
"
|
||||
bind .ins.center.left.l <Enter> "xschem abort_operation"
|
||||
label .ins.bottom.n -text { N. of items:}
|
||||
label .ins.bottom.nitems -textvariable insert_symbol(nitems)
|
||||
|
|
@ -9066,7 +9068,7 @@ proc build_widgets { {topwin {} } } {
|
|||
$topwin.menubar.tools add command -label "Insert snap wire" -command "xschem snap_wire" -accelerator Shift+W
|
||||
$topwin.menubar.tools add command -label "Insert line" -command "xschem line" -accelerator L
|
||||
$topwin.menubar.tools add command -label "Insert rect" -command "xschem rect" -accelerator R
|
||||
$topwin.menubar.tools add command -label "Insert polygon" -command "xschem polygon" -accelerator Ctrl+P
|
||||
$topwin.menubar.tools add command -label "Insert polygon" -command "xschem polygon" -accelerator P
|
||||
$topwin.menubar.tools add command -label "Insert arc" -command "xschem arc" -accelerator Shift+C
|
||||
$topwin.menubar.tools add command -label "Insert circle" -command "xschem circle" -accelerator Ctrl+Shift+C
|
||||
$topwin.menubar.tools add command -label "Insert JPG/PNG/SVG image" -command "xschem add_image"
|
||||
|
|
|
|||
Loading…
Reference in New Issue