You mixed up the conditional here. On OS X, Y = 0 is at the bottom of the screen/view (by default), so ceiling the Y coordinate will round the view upward.