diff options
author | nicolasroard <nicolasroard@google.com> | 2012-11-29 00:01:59 -0800 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2012-11-29 00:20:33 -0800 |
commit | c5317f7dbd812f83ba086817d077f44ea4494f91 (patch) | |
tree | ee5754f2d280a58d0215583826bc04e2e5ff3a5e /src/com/android/gallery3d/filtershow/ui/ImageCurves.java | |
parent | 73487035ea64b59b62ee280cd73e8c1bfaf64f8f (diff) | |
download | android_packages_apps_Snap-c5317f7dbd812f83ba086817d077f44ea4494f91.tar.gz android_packages_apps_Snap-c5317f7dbd812f83ba086817d077f44ea4494f91.tar.bz2 android_packages_apps_Snap-c5317f7dbd812f83ba086817d077f44ea4494f91.zip |
(re-)add vertical/horizontal lines when moving Curves
Align histogram with Curves grid.
bug:7361722
Change-Id: I327f3fb0ba844cc09f8b899e59f74d368478d30a
Diffstat (limited to 'src/com/android/gallery3d/filtershow/ui/ImageCurves.java')
-rw-r--r-- | src/com/android/gallery3d/filtershow/ui/ImageCurves.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/filtershow/ui/ImageCurves.java b/src/com/android/gallery3d/filtershow/ui/ImageCurves.java index 405524862..7b04133ce 100644 --- a/src/com/android/gallery3d/filtershow/ui/ImageCurves.java +++ b/src/com/android/gallery3d/filtershow/ui/ImageCurves.java @@ -221,7 +221,6 @@ public class ImageCurves extends ImageSlave { } if (spline.isPointContained(posX, pick)) { - spline.didMovePoint(mCurrentControlPoint); spline.movePoint(pick, posX, posY); } else if (pick != -1 && spline.getNbPoints() > 2) { spline.deletePoint(pick); @@ -279,8 +278,9 @@ public class ImageCurves extends ImageSlave { max = histogram[i]; } } - float w = getWidth(); - float h = getHeight(); + float w = getWidth() - Spline.curveHandleSize(); + float h = getHeight() - Spline.curveHandleSize() / 2.0f; + float dx = Spline.curveHandleSize() / 2.0f; float wl = w / histogram.length; float wh = (0.3f * h) / max; Paint paint = new Paint(); @@ -292,12 +292,12 @@ public class ImageCurves extends ImageSlave { paint2.setStrokeWidth(6); paint2.setXfermode(new PorterDuffXfermode(mode)); gHistoPath.reset(); - gHistoPath.moveTo(0, h); + gHistoPath.moveTo(dx, h); boolean firstPointEncountered = false; float prev = 0; float last = 0; for (int i = 0; i < histogram.length; i++) { - float x = i * wl; + float x = i * wl + dx; float l = histogram[i] * wh; if (l != 0) { float v = h - (l + prev) / 2.0f; |