- double x=0,y=0;
- if(r.xmin == r.xmax) {
- x = minlinewidth;
- } else {
- y = minlinewidth;
- }
- /* warning: doing this inside endshape() is dangerous */
- moveto(tag, r.xmin/20.0 , r.ymin/20.0);
- lineto(tag, r.xmax/20.0 + x, r.ymin/20.0);
- lineto(tag, r.xmax/20.0 + x, r.ymax/20.0 + y);
- lineto(tag, r.xmin/20.0 , r.ymax/20.0 + y);
- lineto(tag, r.xmin/20.0 , r.ymin/20.0);
+ cancelshape(obj);
+
+ RGBA save_col = obj->strokergb;
+ int save_width = linewidth;
+
+ obj->strokergb = obj->fillrgb;
+ linewidth = (int)(minlinewidth*20);
+ if(linewidth==0) linewidth = 1;
+
+ startshape(obj);
+
+ moveto(tag, r.xmin/20.0,r.ymin/20.0);
+ lineto(tag, r.xmax/20.0,r.ymax/20.0);
+
+ obj->strokergb = save_col;
+ linewidth = save_width;