Minor fixes/clarifications for previous patch.

Change-Id: Ib44f6de570064b3f3ddf70b6727b479a09ae5d7a
This commit is contained in:
Adam Powell
2012-09-16 12:04:39 -07:00
parent b45965f519
commit b1861c3e89
2 changed files with 9 additions and 4 deletions

View File

@@ -213,8 +213,7 @@ public class ScaleGestureDetector {
for (int i = 0; i < count; i++) {
if (skipIndex == i) continue;
// touchMajor/Minor are axes of an ellipse; average them together and
// convert the resulting 'diameter' into a radius.
// Average touch major and touch minor and convert the resulting diameter into a radius.
final float touchSize = (event.getTouchMajor(i) + event.getTouchMinor(i)) / 4;
devSumX += Math.abs(event.getX(i) - focusX) + touchSize;
devSumY += Math.abs(event.getY(i) - focusY) + touchSize;
@@ -245,7 +244,7 @@ public class ScaleGestureDetector {
mPrevSpanY = mCurrSpanY = spanY;
mInitialSpan = mPrevSpan = mCurrSpan = span;
}
if (!mInProgress && span > mMinSpan &&
if (!mInProgress && span >= mMinSpan &&
(wasInProgress || Math.abs(span - mInitialSpan) > mSpanSlop)) {
mPrevSpanX = mCurrSpanX = spanX;
mPrevSpanY = mCurrSpanY = spanY;

View File

@@ -927,8 +927,14 @@
<integer name="config_multiuserMaximumUsers">1</integer>
<!-- Minimum span needed to begin a touch scaling gesture.
If the span is equal to or greater than this size, a scaling gesture
will begin, where supported. (See android.view.ScaleGestureDetector)
This also takes into account the size of any active touch points.
Devices with screens that deviate too far from their assigned density
bucket should consider tuning this value in a device-specific overlay. -->
bucket should consider tuning this value in a device-specific overlay.
For best results, care should be taken such that this value remains
larger than the minimum reported touchMajor/touchMinor values
reported by the hardware. -->
<dimen name="config_minScalingSpan">25mm</dimen>
</resources>