static Pt normalizePointToScreen(Pt p) { ret new Pt( min(screenWidth()-1, max(p.x, 0)), min(screenHeight()-1, max(p.y, 0))); }