fixed a bug in complex rect corner calc