Aliasing when drawing shapes with floats for dimensions

This type of aliasing occurs when I draw a rectangle with float dimensions. No aliasing if I use integers. Any way around this (other than using ints?) Intel iris GPU on a Macbook. Have ofEnableAntiAliasing() enabled.

51 PM

unknown-1

ofDrawRectangle(300,300,100,100);
ofDrawRectangle(450,300,100.5,100.5);

It’s really subtle, but you can see it on the right square on the right and bottom edges. The goal is to be able to use floats but not have the “aliasing”, or whatever it is (and also to understand why it’s happening).

I need to use floats because I need to be able to evenly divide the screen perfectly into N rectangles.

this happens because since there are no half physical pixels it tries to interpolate the colors of the object and background. this is the desired behavior.
You will have to use ints to divide. if division is not perfect you will have to adopt uneven widths, like 33, 33, 34.

Thanks. I realized that this is happening because aliasing is turned on. Since my scene consists only over perfectly horizontal and vertical lines, I get a small boost in quality from turning it off.