apply size constraints