summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/imageshow
diff options
context:
space:
mode:
authorJohn Hoford <hoford@google.com>2013-05-01 13:19:06 -0700
committerJohn Hoford <hoford@google.com>2013-05-01 13:19:06 -0700
commitd16de2ee0d4abc6dc46b949f693b1a865344dfa3 (patch)
tree760425b4a30af0b510e0045d083200253f13ca7d /src/com/android/gallery3d/filtershow/imageshow
parent4f7fe16804568f9bcb189ab7916e403f8b1e2f90 (diff)
parentb15919a1bccfcecd24c35001837626c73b0a4bdb (diff)
downloadandroid_packages_apps_Snap-d16de2ee0d4abc6dc46b949f693b1a865344dfa3.tar.gz
android_packages_apps_Snap-d16de2ee0d4abc6dc46b949f693b1a865344dfa3.tar.bz2
android_packages_apps_Snap-d16de2ee0d4abc6dc46b949f693b1a865344dfa3.zip
resolved conflicts for merge of d6edcee3 to gb-ub-photos-carlsbad
Change-Id: I24057e85ca5b0409e9bcb92c85577fb9a763fbe4
Diffstat (limited to 'src/com/android/gallery3d/filtershow/imageshow')
-rw-r--r--src/com/android/gallery3d/filtershow/imageshow/EclipseControl.java44
1 files changed, 28 insertions, 16 deletions
diff --git a/src/com/android/gallery3d/filtershow/imageshow/EclipseControl.java b/src/com/android/gallery3d/filtershow/imageshow/EclipseControl.java
index a3296779e..e334fc9f4 100644
--- a/src/com/android/gallery3d/filtershow/imageshow/EclipseControl.java
+++ b/src/com/android/gallery3d/filtershow/imageshow/EclipseControl.java
@@ -46,6 +46,7 @@ public class EclipseControl {
private float mDownRadiusY;
private Matrix mScrToImg;
+ private boolean mShowReshapeHandles = true;
public final static int HAN_CENTER = 0;
public final static int HAN_NORTH = 7;
public final static int HAN_NE = 8;
@@ -57,7 +58,7 @@ public class EclipseControl {
public final static int HAN_NW = 6;
public EclipseControl(Context context) {
- mSliderColor = context.getResources().getColor(R.color.slider_line_color);
+ mSliderColor = Color.WHITE;
}
public void setRadius(float x, float y) {
@@ -215,29 +216,36 @@ public class EclipseControl {
canvas.drawOval(rect, paint);
float da = 4;
float arclen = da + da;
- for (int i = 0; i < 361; i += 90) {
- float dx = rx + 10;
- float dy = ry + 10;
- rect.left = cx - dx;
- rect.top = cy - dy;
- rect.right = cx + dx;
- rect.bottom = cy + dy;
- canvas.drawArc(rect, i - da, arclen, false, paint);
- dx = rx - 10;
- dy = ry - 10;
- rect.left = cx - dx;
- rect.top = cy - dy;
- rect.right = cx + dx;
- rect.bottom = cy + dy;
- canvas.drawArc(rect, i - da, arclen, false, paint);
+ if (mShowReshapeHandles) {
+ paint.setStyle(Paint.Style.STROKE);
+
+ for (int i = 0; i < 361; i += 90) {
+ float dx = rx + 10;
+ float dy = ry + 10;
+ rect.left = cx - dx;
+ rect.top = cy - dy;
+ rect.right = cx + dx;
+ rect.bottom = cy + dy;
+ canvas.drawArc(rect, i - da, arclen, false, paint);
+ dx = rx - 10;
+ dy = ry - 10;
+ rect.left = cx - dx;
+ rect.top = cy - dy;
+ rect.right = cx + dx;
+ rect.bottom = cy + dy;
+ canvas.drawArc(rect, i - da, arclen, false, paint);
+ }
}
da *= 2;
+ paint.setStyle(Paint.Style.FILL);
+
for (int i = 45; i < 361; i += 90) {
double angle = Math.PI * i / 180.;
float x = cx + (float) (rx * Math.cos(angle));
float y = cy + (float) (ry * Math.sin(angle));
canvas.drawRect(x - da, y - da, x + da, y + da, paint);
}
+ paint.setStyle(Paint.Style.STROKE);
rect.left = cx - rx;
rect.top = cy - ry;
rect.right = cx + rx;
@@ -270,4 +278,8 @@ public class EclipseControl {
public boolean isUndefined() {
return Float.isNaN(mCenterX);
}
+
+ public void setShowReshapeHandles(boolean showReshapeHandles) {
+ this.mShowReshapeHandles = showReshapeHandles;
+ }
}