fix rect alignment when text alignment is right