Fill Problem with a Rectangle in a Rectangle

All,

I have run across an interesting problem.

When I draw an unfilled rectangle around a filled rectangle the filled rectangle doesn’t doesn’t fill the outline entirely. It leaves a strip along the right side and the bottom.

  
  ofSetHexColor(0xffffff);  
  ofNoFill();  
  ofRect(400, 100, 200, 200);  
  
  ofSetHexColor(0xffffff);  
  ofFill();  
  ofRect(401, 101, 198, 198);  

If I set both rectangles to ofNoFill they line up and I get what looks like a rectangle with a line width of two.

  
  ofSetHexColor(0xffffff);  
  ofNoFill();  
  ofRect(400, 100, 200, 200);  
  
  ofSetHexColor(0xffffff);  
  ofFill();  
  ofRect(401, 101, 198, 198);  

Has anyone seen anything like this before? Does anyone have any ideas on how to fix it.

For now I am working around it by drawing two rectangles for the inside rectangle. The first rectangle is drawn with ofNoFill and the second with ofFill.

Any suggestions would be greatly appreciated.

Thanks,

digitalhack

are you trying to draw a rectangle with a fill color and an outline with a different color? in your post you’re drawing everything as white but i guess is just a typo. anyway i guess something like:

  
  
  ofSetHexColor(0xffffff);  
  ofFill();  
  ofRect(400, 100, 200, 200);  
.  
  ofSetHexColor(0x000000);  
  ofNoFill();  
  ofRect(400, 100, 200, 200);  

will work. i will take a look at the problem in your code though. this is with the git version right? do you know if this was happening before?

arturo,

You are correct that I am using a version from github that I downloaded back in February. Tonight I checked with pre release 0.062 from the openFrameworks website and with a copy downloaded from github tonight. The problem exists with both versions.

The actual program I am working on has a larger amount of space between the outside outline rectangle and the inside filled rectangle. It didn’t look centered but it wasn’t until I dropped down to a the filled rectangle in the outline rectangle that the exact problem became clear. That is why the example code is what it is.

Thanks!

digitalhack