draw_crosshair(): more logical what parameter values
This commit is contained in:
parent
26bfe7691b
commit
4700483fa4
|
|
@ -1335,7 +1335,7 @@ static int waves_callback(int event, int mx, int my, KeySym key, int button, int
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* what == 0 : delete and draw
|
||||
/* what == 3 : delete and draw
|
||||
* what == 1 : delete
|
||||
* what == 2 : draw */
|
||||
void draw_crosshair(int what)
|
||||
|
|
@ -1350,7 +1350,7 @@ void draw_crosshair(int what)
|
|||
|
||||
xctx->draw_pixmap = 0;
|
||||
xctx->draw_window = 1;
|
||||
if(what != 2) { /* delete previous */
|
||||
if(what & 1) { /* delete previous */
|
||||
if(fix_broken_tiled_fill || !_unix) {
|
||||
if(xhair_size) {
|
||||
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0],
|
||||
|
|
@ -1408,7 +1408,7 @@ void draw_crosshair(int what)
|
|||
}
|
||||
}
|
||||
}
|
||||
if(what != 1) { /* draw new */
|
||||
if(what & 2) { /* draw new */
|
||||
if(xhair_size) {
|
||||
draw_xhair_line(xctx->gc[xctx->crosshair_layer], xhair_size,
|
||||
X_TO_SCREEN(xctx->mousex_snap) - xhair_size,
|
||||
|
|
@ -1439,7 +1439,7 @@ void draw_crosshair(int what)
|
|||
X_TO_SCREEN(xctx->mousex_snap), xctx->areay2);
|
||||
}
|
||||
}
|
||||
draw_selection(xctx->gc[SELLAYER], 0);
|
||||
if(what) draw_selection(xctx->gc[SELLAYER], 0);
|
||||
xctx->prev_crossx = xctx->mousex_snap;
|
||||
xctx->prev_crossy = xctx->mousey_snap;
|
||||
|
||||
|
|
@ -4302,7 +4302,7 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
break;
|
||||
}
|
||||
|
||||
if(draw_xhair) draw_crosshair(0);
|
||||
if(draw_xhair) draw_crosshair(3);
|
||||
break;
|
||||
case -3: /* double click : edit prop */
|
||||
if( waves_selected(event, key, state, button)) {
|
||||
|
|
|
|||
|
|
@ -5137,7 +5137,7 @@ void draw(void)
|
|||
} else {
|
||||
draw_selection(xctx->gc[SELLAYER], 0); /* 20181009 moved outside of cadlayers loop */
|
||||
}
|
||||
if(tclgetboolvar("draw_crosshair")) draw_crosshair(0);
|
||||
if(tclgetboolvar("draw_crosshair")) draw_crosshair(3);
|
||||
} /* if(has_x) */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -907,7 +907,7 @@ void copy_objects(int what)
|
|||
xctx->rotatelocal=0;
|
||||
} /* if(what & END) */
|
||||
draw_selection(xctx->gc[SELLAYER], 0);
|
||||
if(tclgetboolvar("draw_crosshair")) draw_crosshair(0);
|
||||
if(tclgetboolvar("draw_crosshair")) draw_crosshair(3);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1361,5 +1361,5 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
xctx->rotatelocal=0;
|
||||
} /* what & end */
|
||||
draw_selection(xctx->gc[SELLAYER], 0);
|
||||
if(tclgetboolvar("draw_crosshair")) draw_crosshair(0);
|
||||
if(tclgetboolvar("draw_crosshair")) draw_crosshair(3);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue