sproutcore/sproutcore — pull request #1235 by jameschao (2014-05-07 12:32:14+00:00)
Title: Improved SC.ScrollView scaling by pivoting around the center of viewable area

Improved SC.ScrollView scaling by pivoting around the center of viewable area.

Previously, the zooming happens only around the top left corner, which doesn't quite feel as natural. I implemented logic so that zooming appears like it's centered around the center of the viewable area in the scroll view (technically the container view).

When the content view is small, we also respect scroll view's horizontalAlign and verticalAlign properties to position the content view.

Additional change: added originalWidth and originalHeight to view frames as these are needed in the calculations.