Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!alchemy!markov From: markov@cs.ruu.nl (Mark Overmars) Newsgroups: comp.sys.sgi Subject: problem with erasing rectsngle boundaries Message-ID: <1991Apr22.081357.28429@cs.ruu.nl> Date: 22 Apr 91 08:13:57 GMT Organization: Utrecht University, Dept. of Computer Science Lines: 30 When running the following program the black frame is not completely overwritten by the red rectangle. Why is this? Is this an error? Or should I draw the rectangle frame differently (e.g. in a different order). (I need this because sometimes I want to draw a frame around a rectangle and sometimes not. When drawing the rectangle without the fram it should of course erase the previous rectangle and the frame.) Mark Overmars #include vv(float x,float y) { float v[2] ; v[0] = x; v[1] = y; v2f(v);} draw_rect(float x, float y, float w, float h) { color(BLACK); bgnclosedline(); vv(x,y); vv(x,y+h); vv(x+w,y+h); vv(x+w,y); endclosedline(); color(RED); bgnpolygon(); vv(x,y); vv(x,y+h); vv(x+w,y+h); vv(x+w,y); endpolygon(); } main() { winopen("TEST"); color(WHITE); clear(); draw_rect(50.0,50.0,100.0,100.0); sleep(20); }