diff options
Diffstat (limited to 'src/com/android')
-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; |