Exemple #1
0
void 
BWDrawRectangle(Widget w, 
		Position from_x, Position from_y, 
		Position to_x, Position to_y, int value)
{
    register Position i;
    Dimension delta, width, height;
    
    QuerySwap(from_x, to_x);
    QuerySwap(from_y, to_y);
    
    width = to_x - from_x;
    height = to_y - from_y;

    delta = max(width, height);
    
    if (!QueryZero(width, height)) {
	for (i = 0; (int)i < (int)delta; i++) {
	    if ((int)i < (int)width) {
		BWDrawPoint(w, from_x + i, from_y, value);
		BWDrawPoint(w, to_x - i, to_y, value);
	    }
	    if ((int)i < (int)height) {
		BWDrawPoint(w, from_x, to_y - i, value);
		BWDrawPoint(w, to_x, from_y + i, value);
	    }
	}
    }
    else
	BWDrawLine(w, 
		   from_x, from_y, 
		   to_x, to_y, value);
}
Exemple #2
0
void plotarrow(vector u,vector d)
{
  vector h; /* Head of arrow */
  
  h=Vadd(u,d);
  if (!(Vequal(d,V(0,0))))
    BWDrawLine(window2,scrx(u),scry(u),scrx(h),scry(h));
}
Exemple #3
0
void plotarrow(BasicWin window,vector u,vector d)
{
  vector h; /* Head of arrow */
  
  if (radius(d)>0.005) {
    h=Vadd(u,d);
    BWDrawLine(window,scrx(u),scry(u),scrx(h),scry(h));
  }
}