round of center calculation

avoid centering loop caused by sub pixel rounding making margins whole
numbers.