[Xcircuit-dev] code suggestion for major grid of snap points
John Barry
john.barry at tyndall.ie
Thu Aug 30 07:51:50 PDT 2007
Hi,
I added the following code to line 5932, events.c(Xcircuit v 3.6.79)
It creates a grid of major snaps points - handy as a discrete guide for
for regular placement of devices and routing between(the alternative of
keeping the grid on all the time is harder on the eyes)
John
/* jdb draw major snap points */
/* spc3 = Xw units(pixels) per major snapspace */
float major_snapspace = xobjs.pagelist[areawin->page]->gridspace *20;
float spc3 = major_snapspace * areawin->vscale;
if (spc > 4) {
fpart = (float)(-areawin->pcorner.x)
/ major_snapspace;
x = major_snapspace *
(fpart - (float)((int)fpart)) * areawin->vscale;
fpart = (float)(-areawin->pcorner.y)
/ major_snapspace;
y = major_snapspace *
(fpart - (float)((int)fpart)) * areawin->vscale;
SetForeground(dpy, areawin->gc, GRIDCOLOR);
for (i = x; i < (float)areawin->width; i += spc3) {
for (j = (float)areawin->height - y; j > 0; j -= spc3) {
XDrawArc(dpy, win, areawin->gc , (int)(i + 0.5)-1, (int)(j -
0.5)-1, 2, 2, 0, 360*64);
}
}
};
More information about the Xcircuit-dev
mailing list