569 |
// If the bottom boundary of contentRect is below the port |
// If the bottom boundary of contentRect is below the port |
570 |
// boundaries, scroll up as necessary. |
// boundaries, scroll up as necessary. |
571 |
if (contentRect.y + contentRect.height + viewBounds.y > portBounds.height) |
if (contentRect.y + contentRect.height + viewBounds.y > portBounds.height) |
572 |
pos.y = contentRect.y + contentRect.height - viewBounds.height; |
pos.y = contentRect.y + contentRect.height - portBounds.height; |
573 |
// If contentRect.y is above the port boundaries, scroll down to |
// If contentRect.y is above the port boundaries, scroll down to |
574 |
// contentRect.y. |
// contentRect.y. |
575 |
if (contentRect.y + viewBounds.y < 0) |
if (contentRect.y + viewBounds.y < 0) |
577 |
// If the right boundary of contentRect is right from the port |
// If the right boundary of contentRect is right from the port |
578 |
// boundaries, scroll left as necessary. |
// boundaries, scroll left as necessary. |
579 |
if (contentRect.x + contentRect.width + viewBounds.x > portBounds.width) |
if (contentRect.x + contentRect.width + viewBounds.x > portBounds.width) |
580 |
pos.x = contentRect.x + contentRect.width - viewBounds.width; |
pos.x = contentRect.x + contentRect.width - portBounds.width; |
581 |
// If contentRect.x is left from the port boundaries, scroll right to |
// If contentRect.x is left from the port boundaries, scroll right to |
582 |
// contentRect.x. |
// contentRect.x. |
583 |
if (contentRect.x + viewBounds.x < 0) |
if (contentRect.x + viewBounds.x < 0) |