static Rect centerRect(Rect a, Rect b) { if (a == null || b == null) ret a; ret Rect(b.x+(b.w-a.w)/2, b.y+(b.h-a.h)/2, a.w, a.h); }