diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-26 15:02:59 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-26 15:02:59 -0700 |
commit | d22c64f377532969e61ec319f3b9f8a179ae8d47 (patch) | |
tree | e0586971474a057c1c044a344053b532471fe962 /core | |
parent | 9762b53352edc4cc8a6bc091930fc53dedcfe1e7 (diff) | |
parent | b082ceefdc877bda2159a8d66d854576e0511d15 (diff) | |
download | frameworks_base-d22c64f377532969e61ec319f3b9f8a179ae8d47.zip frameworks_base-d22c64f377532969e61ec319f3b9f8a179ae8d47.tar.gz frameworks_base-d22c64f377532969e61ec319f3b9f8a179ae8d47.tar.bz2 |
Merge change 2434 into donut
* changes:
Removed Matrix from spatial sampling for GestureUtilities - updated the letter training file
Diffstat (limited to 'core')
-rwxr-xr-x | core/java/android/gesture/GestureUtilities.java | 19 | ||||
-rw-r--r-- | core/res/res/raw/latin_lowercase | bin | 28496 -> 28494 bytes |
2 files changed, 12 insertions, 7 deletions
diff --git a/core/java/android/gesture/GestureUtilities.java b/core/java/android/gesture/GestureUtilities.java index 0f9253d..4a3144c 100755 --- a/core/java/android/gesture/GestureUtilities.java +++ b/core/java/android/gesture/GestureUtilities.java @@ -58,10 +58,10 @@ final class GestureUtilities { float sy = targetPatchSize / rect.height(); float scale = sx < sy ? sx : sy; - Matrix trans = new Matrix(); - trans.setScale(scale, scale); - trans.preTranslate(-rect.centerX(), -rect.centerY()); - trans.postTranslate(targetPatchSize / 2, targetPatchSize / 2); + float preDx = -rect.centerX(); + float preDy = -rect.centerY(); + float postDx = targetPatchSize / 2; + float postDy = targetPatchSize / 2; final ArrayList<GestureStroke> strokes = gesture.getStrokes(); final int count = strokes.size(); @@ -72,11 +72,16 @@ final class GestureUtilities { for (int index = 0; index < count; index++) { final GestureStroke stroke = strokes.get(index); - size = stroke.points.length; + float[] strokepoints = stroke.points; + size = strokepoints.length; final float[] pts = new float[size]; - - trans.mapPoints(pts, 0, stroke.points, 0, size / 2); + + for (int i = 0; i < size; i += 2) { + pts[i] = (strokepoints[i] + preDx) * scale + postDx; + pts[i + 1] = (strokepoints[i + 1] + preDy) * scale + postDy; + } + float segmentEndX = -1; float segmentEndY = -1; diff --git a/core/res/res/raw/latin_lowercase b/core/res/res/raw/latin_lowercase Binary files differindex fd67333..17cfaf0 100644 --- a/core/res/res/raw/latin_lowercase +++ b/core/res/res/raw/latin_lowercase |