improvements in the `Fix for GPUs with broken tiled fill`, no more flickering in selections

This commit is contained in:
stefan schippers 2023-10-27 23:45:54 +02:00
parent 364fb55df1
commit b965fb0ba4
7 changed files with 151 additions and 122 deletions

View File

@ -3397,7 +3397,6 @@ void pan(int what, int mx, int my)
* XCopy Area operations */
void fix_restore_rect(double x1, double y1, double x2, double y2)
{
dbg(0, "---\n");
/* horizontal lines */
MyXCopyAreaDouble(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
x1, y1, x2, y1, x1, y1,
@ -3421,8 +3420,8 @@ void fix_restore_rect(double x1, double y1, double x2, double y2)
/* 20150927 select=1: select objects, select=0: unselect objects */
void select_rect(int what, int select)
{
dbg(1, "select_rect(): mousex_save=%g mousey_save=%g, mousex_snap=%g mousey_snap=%g\n",
xctx->mx_double_save, xctx->my_double_save, xctx->mousex_snap, xctx->mousey_snap);
dbg(1, "select_rect(): what=%d, mousex_save=%g mousey_save=%g, mousex_snap=%g mousey_snap=%g\n",
what, xctx->mx_double_save, xctx->my_double_save, xctx->mousex_snap, xctx->mousey_snap);
if(what & RUBBER)
{
if(xctx->nl_sem==0) {
@ -3431,24 +3430,32 @@ void select_rect(int what, int select)
}
xctx->nl_xx1=xctx->nl_xr;xctx->nl_xx2=xctx->nl_xr2;xctx->nl_yy1=xctx->nl_yr;xctx->nl_yy2=xctx->nl_yr2;
RECTORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
drawtemprect(xctx->gctiled,NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
if(fix_broken_tiled_fill || !_unix) {
fix_restore_rect(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
} else {
drawtemprect(xctx->gctiled,NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
}
xctx->nl_xr2=xctx->mousex_snap;xctx->nl_yr2=xctx->mousey_snap;
/* 20171026 update unselected objects while dragging */
rebuild_selected_array();
#if 0
if(xctx->nl_dir == 0) {
bbox(START,0.0, 0.0, 0.0, 0.0);
bbox(ADD, xctx->nl_xx1, xctx->nl_yy1, xctx->nl_xx2, xctx->nl_yy2);
bbox(SET,0.0, 0.0, 0.0, 0.0);
}
#endif
draw_selection(xctx->gc[SELLAYER], 0);
/* if(xctx->nl_sel) { */
if(xctx->nl_dir == 0) select_inside(xctx->nl_xx1, xctx->nl_yy1, xctx->nl_xx2, xctx->nl_yy2, xctx->nl_sel);
else select_touch(xctx->nl_xx1, xctx->nl_yy1, xctx->nl_xx2, xctx->nl_yy2, xctx->nl_sel);
/* } */
#if 0
if(xctx->nl_dir == 0) {
bbox(END,0.0, 0.0, 0.0, 0.0);
}
#endif
xctx->nl_xx1=xctx->nl_xr;xctx->nl_xx2=xctx->nl_xr2;xctx->nl_yy1=xctx->nl_yr;xctx->nl_yy2=xctx->nl_yr2;
RECTORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
drawtemprect(xctx->gc[SELLAYER],NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
@ -3479,13 +3486,7 @@ void select_rect(int what, int select)
RECTORDER(xctx->nl_xr,xctx->nl_yr,xctx->nl_xr2,xctx->nl_yr2);
if(fix_broken_tiled_fill || !_unix) {
/*
* MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0], xctx->xrect[0].x, xctx->xrect[0].y,
* xctx->xrect[0].width, xctx->xrect[0].height, xctx->xrect[0].x, xctx->xrect[0].y);
*/
MyXCopyAreaDouble(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
xctx->nl_xr, xctx->nl_yr, xctx->nl_xr2, xctx->nl_yr2, xctx->nl_xr, xctx->nl_yr, xctx->lw);
fix_restore_rect(xctx->nl_xr, xctx->nl_yr, xctx->nl_xr2, xctx->nl_yr2);
} else {
drawtemprect(xctx->gctiled, NOW, xctx->nl_xr,xctx->nl_yr,xctx->nl_xr2,xctx->nl_yr2);
}
@ -3494,15 +3495,19 @@ void select_rect(int what, int select)
if(xctx->nl_dir == 0) select_inside(xctx->nl_xr,xctx->nl_yr,xctx->nl_xr2,xctx->nl_yr2, xctx->nl_sel);
else select_touch(xctx->nl_xr,xctx->nl_yr,xctx->nl_xr2,xctx->nl_yr2, xctx->nl_sel);
#if 0
if(xctx->nl_dir == 0) {
bbox(START,0.0, 0.0, 0.0, 0.0);
bbox(ADD, xctx->nl_xr, xctx->nl_yr, xctx->nl_xr2, xctx->nl_yr2);
bbox(SET,0.0, 0.0, 0.0, 0.0);
}
#endif
draw_selection(xctx->gc[SELLAYER], 0);
#if 0
if(xctx->nl_dir == 0) {
bbox(END,0.0, 0.0, 0.0, 0.0);
}
#endif
/* /20171219 */
xctx->ui_state &= ~STARTSELECT;

View File

@ -1211,17 +1211,7 @@ int rstate; /* (reduced state, without ShiftMask) */
waves_callback(event, mx, my, key, button, aux, state);
break;
}
if(xctx->ui_state & STARTPAN) pan(RUBBER, mx, my);
if(fix_broken_tiled_fill || !_unix) {
if ((xctx->ui_state & STARTWIRE) || (xctx->ui_state & STARTARC) ||
(xctx->ui_state & STARTLINE) || (xctx->ui_state & STARTMOVE) ||
(xctx->ui_state & STARTCOPY) || (xctx->ui_state & STARTRECT) ||
(xctx->ui_state & STARTPOLYGON) || /* (xctx->ui_state & STARTPAN) || */
(xctx->ui_state & STARTSELECT)) {
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0], xctx->xrect[0].x, xctx->xrect[0].y,
xctx->xrect[0].width, xctx->xrect[0].height, xctx->xrect[0].x, xctx->xrect[0].y);
}
}
if(xctx->ui_state & STARTPAN) pan(RUBBER, mx, my);
if(draw_xhair) {
draw_crosshair(0);
}

View File

@ -406,9 +406,6 @@ void draw_temp_string(GC gctext, int what, const char *str, short rot, short fli
int tmp;
double dtmp;
if(!has_x) return;
if(fix_broken_tiled_fill || !_unix) {
if(gctext == xctx->gctiled) return;
}
dbg(2, "draw_string(): string=%s\n",str);
if(!text_bbox(str, xscale, yscale, rot, flip, hcenter, vcenter, x1,y1,
@ -728,10 +725,6 @@ void draw_temp_symbol(int what, GC gc, int n,int layer,short tmp_flip, short rot
if(xctx->inst[n].ptr == -1) return;
if(!has_x) return;
if(fix_broken_tiled_fill || !_unix) {
if(gc == xctx->gctiled) return;
}
if( (xctx->inst[n].flags & HIDE_INST) ||
(xctx->hide_symbols==1 && (xctx->inst[n].ptr+ xctx->sym)->prop_ptr &&
!strcmp( (xctx->inst[n].ptr+ xctx->sym)->type, "subcircuit") ) ||
@ -1162,10 +1155,8 @@ void drawtempline(GC gc, int what, double linex1,double liney1,double linex2,dou
double x1,y1,x2,y2;
if(!has_x) return;
if(fix_broken_tiled_fill || !_unix) {
if(gc == xctx->gctiled) return;
}
if((fix_broken_tiled_fill || !_unix) && gc == xctx->gctiled && what == ADD) what = NOW;
if(what & ADD)
{
if(i>=CADDRAWBUFFERSIZE)
@ -1200,7 +1191,13 @@ void drawtempline(GC gc, int what, double linex1,double liney1,double linex2,dou
y2=Y_TO_SCREEN(liney2);
if( clip(&x1,&y1,&x2,&y2) )
{
XDrawLine(display, xctx->window, gc, (int)x1, (int)y1, (int)x2, (int)y2);
if((fix_broken_tiled_fill || !_unix) && gc == xctx->gctiled) {
RECTORDER(linex1, liney1, linex2, liney2);
MyXCopyAreaDouble(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
linex1, liney1, linex2, liney2, linex1, liney1, xctx->lw);
} else {
XDrawLine(display, xctx->window, gc, (int)x1, (int)y1, (int)x2, (int)y2);
}
}
}
else if(what & THICK)
@ -1211,10 +1208,14 @@ void drawtempline(GC gc, int what, double linex1,double liney1,double linex2,dou
y2=Y_TO_SCREEN(liney2);
if( clip(&x1,&y1,&x2,&y2) )
{
XSetLineAttributes (display, gc, INT_BUS_WIDTH(xctx->lw), LineSolid, LINECAP , LINEJOIN);
XDrawLine(display, xctx->window, gc, (int)x1, (int)y1, (int)x2, (int)y2);
XSetLineAttributes (display, gc, XLINEWIDTH(xctx->lw), LineSolid, LINECAP , LINEJOIN);
if((fix_broken_tiled_fill || !_unix) && gc == xctx->gctiled) {
MyXCopyAreaDouble(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
linex1, liney1, linex2, liney2, linex1, liney1, BUS_WIDTH * xctx->lw);
} else {
XSetLineAttributes (display, gc, INT_BUS_WIDTH(xctx->lw), LineSolid, LINECAP , LINEJOIN);
XDrawLine(display, xctx->window, gc, (int)x1, (int)y1, (int)x2, (int)y2);
XSetLineAttributes (display, gc, XLINEWIDTH(xctx->lw), LineSolid, LINECAP , LINEJOIN);
}
}
}
@ -1239,10 +1240,7 @@ void drawtemparc(GC gc, int what, double x, double y, double r, double a, double
double xx1, yy1, xx2, yy2; /* complete circle bbox in screen coords */
if(!has_x) return;
if(fix_broken_tiled_fill || !_unix) {
if(gc == xctx->gctiled) return;
}
if((fix_broken_tiled_fill || !_unix) && gc == xctx->gctiled && what == ADD) what = NOW;
if(what & ADD)
{
if(i>=CADDRAWBUFFERSIZE)
@ -1272,19 +1270,25 @@ void drawtemparc(GC gc, int what, double x, double y, double r, double a, double
}
else if(what & NOW)
{
double sx1, sy1, sx2, sy2;
xx1=X_TO_SCREEN(x-r);
yy1=Y_TO_SCREEN(y-r);
xx2=X_TO_SCREEN(x+r);
yy2=Y_TO_SCREEN(y+r);
arc_bbox(x, y, r, a, b, &x1,&y1,&x2,&y2);
x1=X_TO_SCREEN(x1);
y1=Y_TO_SCREEN(y1);
x2=X_TO_SCREEN(x2);
y2=Y_TO_SCREEN(y2);
if( rectclip(xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2,&x1,&y1,&x2,&y2) )
sx1=X_TO_SCREEN(x1);
sy1=Y_TO_SCREEN(y1);
sx2=X_TO_SCREEN(x2);
sy2=Y_TO_SCREEN(y2);
if( rectclip(xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2,&sx1,&sy1,&sx2,&sy2) )
{
XDrawArc(display, xctx->window, gc, (int)xx1, (int)yy1, (int)(xx2-xx1), (int)(yy2-yy1),
(int)(a*64), (int)(b*64));
if((fix_broken_tiled_fill || !_unix) && gc == xctx->gctiled) {
MyXCopyAreaDouble(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
x1, y1, x2, y2, x1, y1, xctx->lw);
} else {
XDrawArc(display, xctx->window, gc, (int)xx1, (int)yy1, (int)(xx2-xx1), (int)(yy2-yy1),
(int)(a*64), (int)(b*64));
}
}
}
else if((what & END) && i)
@ -1667,32 +1671,35 @@ void drawpolygon(int c, int what, double *x, double *y, int points, int poly_fil
my_free(_ALLOC_ID_, &p);
}
void drawtemppolygon(GC g, int what, double *x, double *y, int points)
void drawtemppolygon(GC gc, int what, double *x, double *y, int points)
{
double x1,y1,x2,y2;
double sx1,sy1,sx2,sy2;
XPoint *p;
int i;
short sx, sy;
if(!has_x) return;
if(fix_broken_tiled_fill || !_unix) {
if(g == xctx->gctiled) return;
}
polygon_bbox(x, y, points, &x1,&y1,&x2,&y2);
x1=X_TO_SCREEN(x1);
y1=Y_TO_SCREEN(y1);
x2=X_TO_SCREEN(x2);
y2=Y_TO_SCREEN(y2);
p = my_malloc(_ALLOC_ID_, sizeof(XPoint) * points);
if( rectclip(xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2,&x1,&y1,&x2,&y2) ) {
for(i=0;i<points; ++i) {
clip_xy_to_short(X_TO_SCREEN(x[i]), Y_TO_SCREEN(y[i]), &sx, &sy);
p[i].x = sx;
p[i].y = sy;
sx1=X_TO_SCREEN(x1);
sy1=Y_TO_SCREEN(y1);
sx2=X_TO_SCREEN(x2);
sy2=Y_TO_SCREEN(y2);
if( rectclip(xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2,&sx1,&sy1,&sx2,&sy2) ) {
if((fix_broken_tiled_fill || !_unix) && gc == xctx->gctiled) {
MyXCopyAreaDouble(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
x1, y1, x2, y2, x1, y1, xctx->lw);
} else {
p = my_malloc(_ALLOC_ID_, sizeof(XPoint) * points);
for(i=0;i<points; ++i) {
clip_xy_to_short(X_TO_SCREEN(x[i]), Y_TO_SCREEN(y[i]), &sx, &sy);
p[i].x = sx;
p[i].y = sy;
}
XDrawLines(display, xctx->window, gc, p, points, CoordModeOrigin);
my_free(_ALLOC_ID_, &p);
}
XDrawLines(display, xctx->window, g, p, points, CoordModeOrigin);
}
my_free(_ALLOC_ID_, &p);
}
void drawrect(int c, int what, double rectx1,double recty1,double rectx2,double recty2, int dash)
@ -1768,9 +1775,7 @@ void drawtemprect(GC gc, int what, double rectx1,double recty1,double rectx2,dou
double x1,y1,x2,y2;
if(!has_x) return;
if(fix_broken_tiled_fill || !_unix) {
if(gc == xctx->gctiled) return;
}
if((fix_broken_tiled_fill || !_unix) && gc == xctx->gctiled && what == ADD) what = NOW;
if(what & NOW)
{
@ -1781,9 +1786,15 @@ void drawtemprect(GC gc, int what, double rectx1,double recty1,double rectx2,dou
/* if( (x2-x1)< 3.0 && (y2-y1)< 3.0) return; */
if( rectclip(xctx->areax1,xctx->areay1,xctx->areax2,xctx->areay2,&x1,&y1,&x2,&y2) )
{
XDrawRectangle(display, xctx->window, gc, (int)x1, (int)y1,
(unsigned int)x2 - (unsigned int)x1,
(unsigned int)y2 - (unsigned int)y1);
if((fix_broken_tiled_fill || !_unix) && gc == xctx->gctiled) {
MyXCopyAreaDouble(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
rectx1, recty1, rectx2, recty2, rectx1, recty1, xctx->lw);
} else {
XDrawRectangle(display, xctx->window, gc, (int)x1, (int)y1,
(unsigned int)x2 - (unsigned int)x1,
(unsigned int)y2 - (unsigned int)y1);
}
}
}
else if(what & ADD)

View File

@ -187,6 +187,7 @@ static void update_symbol_bboxes(short rot, short flip)
}
}
}
void draw_selection(GC g, int interruptable)
{
int i, c, k, n;
@ -195,15 +196,8 @@ void draw_selection(GC g, int interruptable)
int customfont;
#endif
dbg(1,"draw_selection\n");
dbg(1,"draw_selection %s\n", g == xctx->gctiled ? "gctiled" : "gcselect");
if(g != xctx->gctiled) xctx->movelastsel = xctx->lastsel;
if(fix_broken_tiled_fill || !_unix) {
if(g == xctx->gctiled) {
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0], xctx->xrect[0].x, xctx->xrect[0].y,
xctx->xrect[0].width, xctx->xrect[0].height, xctx->xrect[0].x, xctx->xrect[0].y);
if(tclgetboolvar("draw_crosshair")) draw_crosshair(0);
}
}
for(i=0;i<xctx->movelastsel; ++i)
{
c = xctx->sel_array[i].col;n = xctx->sel_array[i].n;
@ -449,10 +443,38 @@ void draw_selection(GC g, int interruptable)
ROTATION(xctx->move_rot, xctx->move_flip, xctx->x1, xctx->y_1,
xctx->inst[n].x0, xctx->inst[n].y0, xctx->rx1,xctx->ry1);
}
for(k=0;k<cadlayers; ++k) {
draw_temp_symbol(ADD, g, n, k, xctx->move_flip,
( xctx->move_flip && (xctx->inst[n].rot & 1) ) ? xctx->move_rot+2 : xctx->move_rot,
xctx->rx1-xctx->inst[n].x0+xctx->deltax,xctx->ry1-xctx->inst[n].y0+xctx->deltay);
if((fix_broken_tiled_fill || !_unix) && g == xctx->gctiled) {
short save_flip, save_rot;
double save_x0, save_y0;
double x1, y1, x2, y2;
/* Can be made simpler ? */
dbg(1, "rot=%d flip=%d deltax=%g deltay=%g\n",
xctx->move_rot, xctx->move_flip, xctx->deltax, xctx->deltay);
save_flip = xctx->inst[n].flip;
save_rot = xctx->inst[n].rot;
save_x0 = xctx->inst[n].x0;
save_y0 = xctx->inst[n].y0;
xctx->inst[n].flip = xctx->move_flip ^ xctx->inst[n].flip;
xctx->inst[n].rot = (xctx->inst[n].rot + xctx->move_rot) & 0x3;
xctx->inst[n].x0 = xctx->rx1+xctx->deltax;
xctx->inst[n].y0 = xctx->ry1+xctx->deltay;
symbol_bbox(n, &x1, &y1, &x2, &y2);
xctx->inst[n].rot = save_rot;
xctx->inst[n].flip = save_flip;
xctx->inst[n].x0 = save_x0;
xctx->inst[n].y0 = save_y0;
MyXCopyAreaDouble(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
x1, y1, x2, y2, x1, y1,
xctx->lw);
} else {
for(k=0;k<cadlayers; ++k) {
draw_temp_symbol(ADD, g, n, k, xctx->move_flip,
( xctx->move_flip && (xctx->inst[n].rot & 1) ) ? xctx->move_rot+2 : xctx->move_rot,
xctx->rx1-xctx->inst[n].x0+xctx->deltax,xctx->ry1-xctx->inst[n].y0+xctx->deltay);
}
}
break;
}
@ -680,11 +702,6 @@ void copy_objects(int what)
if(xctx->connect_by_kissing == 2) xctx->connect_by_kissing = 0;
}
if(fix_broken_tiled_fill || !_unix) {
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0], xctx->xrect[0].x, xctx->xrect[0].y,
xctx->xrect[0].width, xctx->xrect[0].height, xctx->xrect[0].x, xctx->xrect[0].y);
}
xctx->move_rot = xctx->move_flip = 0;
xctx->deltax = xctx->deltay = 0.;
xctx->ui_state&=~STARTCOPY;
@ -699,7 +716,6 @@ void copy_objects(int what)
xctx->x2=xctx->mousex_snap;xctx->y_2=xctx->mousey_snap;
draw_selection(xctx->gctiled,0);
xctx->deltax = xctx->x2-xctx->x1; xctx->deltay = xctx->y_2 - xctx->y_1;
draw_selection(xctx->gc[SELLAYER],1);
}
if(what & ROTATELOCAL ) {
xctx->rotatelocal=1;
@ -1126,12 +1142,7 @@ void move_objects(int what, int merge, double dx, double dy)
pop_undo(0, 0);
if(xctx->connect_by_kissing == 2) xctx->connect_by_kissing = 0;
}
if(fix_broken_tiled_fill || !_unix) {
if(xctx->save_pixmap && xctx->window)
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0], xctx->xrect[0].x, xctx->xrect[0].y,
xctx->xrect[0].width, xctx->xrect[0].height, xctx->xrect[0].x, xctx->xrect[0].y);
}
xctx->move_rot=xctx->move_flip=0;
xctx->deltax=xctx->deltay=0.;
xctx->ui_state &= ~STARTMOVE;
@ -1142,7 +1153,6 @@ void move_objects(int what, int merge, double dx, double dy)
xctx->x2=xctx->mousex_snap;xctx->y_2=xctx->mousey_snap;
draw_selection(xctx->gctiled,0);
xctx->deltax = xctx->x2-xctx->x1; xctx->deltay = xctx->y_2 - xctx->y_1;
draw_selection(xctx->gc[SELLAYER],1);
}
if(what & ROTATELOCAL) {
xctx->rotatelocal=1;

View File

@ -940,13 +940,6 @@ void unselect_all(int dr)
xctx->ui_state &= ~SELECTION;
my_snprintf(str, S(str), "%s/%s", user_conf_dir, ".selection.sch"); /* 20161115 PWD->HOME */
xunlink(str);
if(fix_broken_tiled_fill || !_unix) {
if(xctx->save_pixmap && xctx->window) {
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0], xctx->xrect[0].x, xctx->xrect[0].y,
xctx->xrect[0].width, xctx->xrect[0].height, xctx->xrect[0].x, xctx->xrect[0].y);
if(tclgetboolvar("draw_crosshair")) draw_crosshair(0);
}
}
dbg(2, "unselect_all(1): done\n");
}
}
@ -1068,11 +1061,12 @@ void select_text(int i,unsigned short select_mode, int fast)
xctx->text[i].rot, xctx->text[i].flip, xctx->text[i].hcenter, xctx->text[i].vcenter,
xctx->text[i].x0, xctx->text[i].y0,
xctx->text[i].xscale, xctx->text[i].yscale);
} else
} else {
draw_temp_string(xctx->gctiled,NOW, get_text_floater(i),
xctx->text[i].rot, xctx->text[i].flip, xctx->text[i].hcenter, xctx->text[i].vcenter,
xctx->text[i].x0, xctx->text[i].y0,
xctx->text[i].xscale, xctx->text[i].yscale);
}
#if HAS_CAIRO==1
if(customfont) {
cairo_restore(xctx->cairo_ctx);
@ -1113,12 +1107,10 @@ void select_box(int c, int i, unsigned short select_mode, int fast, int override
xctx->rect[c][i].x2, xctx->rect[c][i].y2);
} else {
xctx->rect[c][i].sel = 0;
drawtemprect(xctx->gctiled, NOW, xctx->rect[c][i].x1, xctx->rect[c][i].y1,
drawtemprect(xctx->gctiled, NOW, xctx->rect[c][i].x1, xctx->rect[c][i].y1,
xctx->rect[c][i].x2, xctx->rect[c][i].y2);
}
if( xctx->rect[c][i].sel == (SELECTED1|SELECTED2|SELECTED3|SELECTED4)) xctx->rect[c][i].sel = SELECTED;
if(xctx->rect[c][i].sel == SELECTED) set_first_sel(xRECT, i, c);
xctx->need_reb_sel_arr=1;
}
@ -1143,13 +1135,13 @@ void select_arc(int c, int i, unsigned short select_mode, int fast)
if(select_mode) {
xctx->arc[c][i].sel = select_mode;
drawtemparc(xctx->gc[SELLAYER], ADD, xctx->arc[c][i].x, xctx->arc[c][i].y,
xctx->arc[c][i].r, xctx->arc[c][i].a, xctx->arc[c][i].b);
xctx->arc[c][i].r, xctx->arc[c][i].a, xctx->arc[c][i].b);
} else {
xctx->arc[c][i].sel = 0;
drawtemparc(xctx->gctiled, NOW, xctx->arc[c][i].x, xctx->arc[c][i].y,
xctx->arc[c][i].r, xctx->arc[c][i].a, xctx->arc[c][i].b);
if(xctx->arc[c][i].sel == SELECTED) set_first_sel(ARC, i, c);
}
if(xctx->arc[c][i].sel == SELECTED) set_first_sel(ARC, i, c);
/*if( xctx->arc[c][i].sel == (SELECTED1|SELECTED2|SELECTED3|SELECTED4)) xctx->arc[c][i].sel = SELECTED; */
@ -1172,10 +1164,11 @@ void select_polygon(int c, int i, unsigned short select_mode, int fast )
}
xctx->poly[c][i].sel = select_mode;
if(select_mode) {
drawtemppolygon(xctx->gc[SELLAYER], NOW, xctx->poly[c][i].x, xctx->poly[c][i].y, xctx->poly[c][i].points);
drawtemppolygon(xctx->gc[SELLAYER], NOW, xctx->poly[c][i].x, xctx->poly[c][i].y, xctx->poly[c][i].points);
}
else {
drawtemppolygon(xctx->gctiled, NOW, xctx->poly[c][i].x, xctx->poly[c][i].y, xctx->poly[c][i].points);
}
else
drawtemppolygon(xctx->gctiled, NOW, xctx->poly[c][i].x, xctx->poly[c][i].y, xctx->poly[c][i].points);
if(xctx->poly[c][i].sel == SELECTED) set_first_sel(POLYGON, i, c);
xctx->need_reb_sel_arr=1;
}
@ -1212,13 +1205,14 @@ void select_line(int c, int i, unsigned short select_mode, int fast )
drawtempline(xctx->gc[SELLAYER], ADD, xctx->line[c][i].x1, xctx->line[c][i].y1,
xctx->line[c][i].x2, xctx->line[c][i].y2);
}
else
if(xctx->line[c][i].bus)
drawtempline(xctx->gctiled, THICK, xctx->line[c][i].x1, xctx->line[c][i].y1,
xctx->line[c][i].x2, xctx->line[c][i].y2);
else
drawtempline(xctx->gctiled, NOW, xctx->line[c][i].x1, xctx->line[c][i].y1,
xctx->line[c][i].x2, xctx->line[c][i].y2);
else {
if(xctx->line[c][i].bus)
drawtempline(xctx->gctiled, THICK, xctx->line[c][i].x1, xctx->line[c][i].y1,
xctx->line[c][i].x2, xctx->line[c][i].y2);
else
drawtempline(xctx->gctiled, NOW, xctx->line[c][i].x1, xctx->line[c][i].y1,
xctx->line[c][i].x2, xctx->line[c][i].y2);
}
xctx->need_reb_sel_arr=1;
}
@ -1269,6 +1263,13 @@ Selected select_object(double mx,double my, unsigned short select_mode, int over
drawtempline(xctx->gc[SELLAYER], END, 0.0, 0.0, 0.0, 0.0);
if(sel.type) xctx->ui_state |= SELECTION;
if(!select_mode) {
rebuild_selected_array();
draw_selection(xctx->gc[SELLAYER], 0);
}
return sel;
}
@ -1525,6 +1526,12 @@ void select_inside(double x1,double y1, double x2, double y2, int sel) /*added u
drawtemparc(xctx->gc[SELLAYER], END, 0.0, 0.0, 0.0, 0.0, 0.0);
drawtemprect(xctx->gc[SELLAYER], END, 0.0, 0.0, 0.0, 0.0);
drawtempline(xctx->gc[SELLAYER], END, 0.0, 0.0, 0.0, 0.0);
if(!sel) {
rebuild_selected_array();
draw_selection(xctx->gc[SELLAYER], 0);
}
}
void select_touch(double x1,double y1, double x2, double y2, int sel) /*added unselect (sel param) */
@ -1655,6 +1662,12 @@ void select_touch(double x1,double y1, double x2, double y2, int sel) /*added un
drawtemparc(xctx->gc[SELLAYER], END, 0.0, 0.0, 0.0, 0.0, 0.0);
drawtemprect(xctx->gc[SELLAYER], END, 0.0, 0.0, 0.0, 0.0);
drawtempline(xctx->gc[SELLAYER], END, 0.0, 0.0, 0.0, 0.0);
if(!sel) {
rebuild_selected_array();
draw_selection(xctx->gc[SELLAYER], 0);
}
}
void select_all(void)

View File

@ -1007,7 +1007,7 @@ typedef struct {
/* select_rect */
double nl_xr, nl_yr, nl_xr2, nl_yr2;
int nl_sel, nl_sem; /* nl_sel is the select mode (select) the select_rect() was called with */
int nl_dir; /* direction of the drag mode select_rect was called with */
int nl_dir; /* direction of the drag select_rect was called with: 0=to the right, 1=to the left */
/* compare_schematics */
char sch_to_compare[PATH_MAX];
/* pan */

View File

@ -4868,7 +4868,7 @@ proc infowindow {} {
if ![winfo exists $z] {
toplevel $z
wm title $z {Info window}
wm transient $z .
# wm transient $z .
wm geometry $z 90x24+0+400
wm iconname $z {Info window}
wm withdraw $z
@ -6727,7 +6727,7 @@ proc build_widgets { {topwin {} } } {
} else {
xschem set fix_broken_tiled_fill 0
}
xschem resetwin 1 1 0 0 0
xschem resetwin 1 1 1 0 0
xschem redraw
}