static int rectMiddleY(Rect r) { ret r == null ? 0 : r.y+r.h/2; }