Substitute viewport()->rect() with whatever you want.