示例#1
0
文件: x11.c 项目: amarnathmhn/ngspice
int
X11_Arc(int x0, int y0, int radius, double theta, double delta_theta)
{
    int t1, t2;

    if (0 && !cp_getvar("x11lineararcs", CP_BOOL, NULL))
        linear_arc(x0, y0, radius, theta, delta_theta);

    if (DEVDEP(currentgraph).isopen) {
        t1 = (int) (64 * (180.0 / M_PI) * theta);
        t2 = (int) (64 * (180.0 / M_PI) * delta_theta);
        if (t2 == 0)
            return 0;
        XDrawArc(display, DEVDEP(currentgraph).window, DEVDEP(currentgraph).gc,
                 x0 - radius,
                 currentgraph->absolute.height - radius - y0,
                 (Dimension) (2 * radius), (Dimension) (2 * radius), t1, t2);
    }

    return 0;
}
示例#2
0
int
X11_Arc(int x0, int y0, int radius, double theta1, double theta2)
{

    int	t1, t2;

    if (!cp_getvar("x11lineararcs", VT_BOOL, (char *) &t1)) {
	linear_arc(x0, y0, radius, theta1, theta2);
    }

    if (DEVDEP(currentgraph).isopen) {
	if (theta1 >= theta2)
	    theta2 = 2 * M_PI + theta2;
	t1 = 64 * (180.0 / M_PI) * theta1;
	t2 = 64 * (180.0 / M_PI) * theta2 - t1;
	if (t2 == 0)
		return 0;
	XDrawArc(display, DEVDEP(currentgraph).window, DEVDEP(currentgraph).gc,
		x0 - radius,
		currentgraph->absolute.height - radius - y0,
		2 * radius, 2 * radius, t1, t2);		
    }
    return 0;
}