fixes pixel predicison issue with drawing rectangles