diff options
author | nicolasroard <nicolasroard@google.com> | 2012-10-23 10:51:42 -0700 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2012-10-23 10:52:42 -0700 |
commit | 3a6614628f8d33f8ce881d85355cebf2b9523252 (patch) | |
tree | b1b0539ecc6b3fe6f15ccd493c5c6d71edbb46b9 | |
parent | cd0a788658ae61e215a677635779a3313e483d96 (diff) | |
download | android_packages_apps_Snap-3a6614628f8d33f8ce881d85355cebf2b9523252.tar.gz android_packages_apps_Snap-3a6614628f8d33f8ce881d85355cebf2b9523252.tar.bz2 android_packages_apps_Snap-3a6614628f8d33f8ce881d85355cebf2b9523252.zip |
Fix slow / jerky tracking in Curves
bug:7394837
Change-Id: I70758b463601faa19d05da58d0163b31df7b4b91
-rw-r--r-- | src/com/android/gallery3d/filtershow/ui/ImageCurves.java | 4 | ||||
-rw-r--r-- | src/com/android/gallery3d/filtershow/ui/Spline.java | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/filtershow/ui/ImageCurves.java b/src/com/android/gallery3d/filtershow/ui/ImageCurves.java index 8f7560e10..4b289e757 100644 --- a/src/com/android/gallery3d/filtershow/ui/ImageCurves.java +++ b/src/com/android/gallery3d/filtershow/ui/ImageCurves.java @@ -202,14 +202,14 @@ public class ImageCurves extends ImageSlave { } if (spline.isPointContained(posX, pick)) { - mCurrentControlPoint.x = posX; - mCurrentControlPoint.y = posY; spline.didMovePoint(mCurrentControlPoint); + spline.movePoint(pick, posX, posY); } else if (pick != -1 && spline.getNbPoints() > 2) { spline.deletePoint(pick); mDidDelete = true; } updateCachedImage(); + invalidate(); return true; } diff --git a/src/com/android/gallery3d/filtershow/ui/Spline.java b/src/com/android/gallery3d/filtershow/ui/Spline.java index 67840dc23..90a7bf9ec 100644 --- a/src/com/android/gallery3d/filtershow/ui/Spline.java +++ b/src/com/android/gallery3d/filtershow/ui/Spline.java @@ -68,6 +68,12 @@ public class Spline { mCurrentControlPoint = point; } + public void movePoint(int pick, float x, float y) { + ControlPoint point = mPoints.elementAt(pick); + point.x = x; + point.y = y; + } + public boolean isOriginal() { if (this.getNbPoints() > 2) { return false; |