How can I override camera.rect?

Hi!
I’ve been making a script that takes two cameras and draws them in a split screen fashion. They are both focused on a seperate object in the world ( parented under them ), it looks like this in game view:

http://imgur.com/dLsfiVb

Then, when I prompt it to, it will slide the two screen rectangles so that they align with a third camera - a top down view, which looks like this:

Problem is when the two rectangles meet the edge of the screen, they shrink. camera.rect.x is clamped to 0 or screen.width, same with y.
This distorts the content within the rectangles, making the objects smaller and centered in the rectangles as shown here

Any ideas on how to prevent this from happening?

I managed to solve it using this tidbit of code:

Vector2 viewportPos = mainCamera.WorldToViewportPoint( myObjectToFocus.transform.position );
float newX = Mathf.Lerp ( camera.rect.x, viewportPos.x - camera.rect.width / 2, Time.deltaTime * myCameraAdjustSpeed );
float newY = Mathf.Lerp ( camera.rect.y, viewportPos.y - camera.rect.height / 2, Time.deltaTime * myCameraAdjustSpeed );
float screenSizePercentage = new Vector2(camera.rect.width, camera.rect.height).magnitude / new Vector2(mainCamera.rect.width, mainCamera.rect.height).magnitude;
float newSize = mainCamera.orthographicSize * screenSizePercentage;
Rect newRect = new Rect( newX, newY, camera.rect.width, camera.rect.height );
Vector2 wantedSize = new Vector2( Screen.width * newRect.width, Screen.height * newRect.height );
Vector2 missingPercentage = new Vector2( camera.pixelWidth / wantedSize.x, camera.pixelHeight / wantedSize.y );
Vector2 wantedPos = new Vector2( Screen.width * newX, Screen.height * newY );
float aspect = wantedSize.x / wantedSize.y;
float forcedAspect = camera.pixelWidth / camera.pixelHeight;
wantedPos.x = newSize * ( missingPercentage.x - 1f ) * (wantedPos.x < 0 ? -1f : 1f);
wantedPos.x *= aspect;
wantedPos.y = newSize * ( missingPercentage.y - 1f ) * (wantedPos.y < 0 ? -1f : 1f);
wantedPos.y /= aspect/mainCamera.aspect;
transform.position = new Vector3(wantedPos.x, transform.position.y, wantedPos.y) + myObjectToFocus.transform.position;
camera.orthographicSize = newSize / ( forcedAspect > aspect ? (forcedAspect / aspect) / missingPercentage.x : 1f / missingPercentage.y);
camera.rect = newRect;

I did the math using pen and paper beforehand. Jikes it was tough. If Unity hadn’t forced the pixelRect everytime you set it, it would’ve been much easier =)