unified FillRect code