summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2012-10-23 15:09:53 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-23 15:09:54 -0700
commit02ed57d123ba96cca284f78df8c6eba776e710ee (patch)
tree0b6c011d2a87dbc55b72ca33e0d2184abf527d9d
parent5894a6b55271727695d7a489dfc06d12fa49c788 (diff)
parent9a9c3b582a407f632aaaa8e704113262796757f4 (diff)
downloadandroid_packages_apps_Snap-02ed57d123ba96cca284f78df8c6eba776e710ee.tar.gz
android_packages_apps_Snap-02ed57d123ba96cca284f78df8c6eba776e710ee.tar.bz2
android_packages_apps_Snap-02ed57d123ba96cca284f78df8c6eba776e710ee.zip
Merge "Express the borders size in percentages" into gb-ub-photos-arches
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java3
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterParametricBorder.java4
2 files changed, 3 insertions, 4 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
index c8c7421f1..5a898c2c3 100644
--- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java
+++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java
@@ -120,7 +120,7 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
private static final int SELECT_PICTURE = 1;
private static final String LOGTAG = "FilterShowActivity";
protected static final boolean ANIMATE_PANELS = true;
- private static int mImageBorderSize = 40;
+ private static int mImageBorderSize = 4; // in percent
private boolean mShowingHistoryPanel = false;
private boolean mShowingImageStatePanel = false;
@@ -154,7 +154,6 @@ public class FilterShowActivity extends Activity implements OnItemClickListener,
ImageButtonTitle.setTextPadding((int) getPixelsFromDip(10));
ImageSmallFilter.setMargin((int) getPixelsFromDip(3));
ImageSmallFilter.setTextMargin((int) getPixelsFromDip(4));
- mImageBorderSize = (int) getPixelsFromDip(20);
Drawable curveHandle = getResources().getDrawable(R.drawable.camera_crop);
int curveHandleSize = (int) getResources().getDimension(R.dimen.crop_indicator_size);
Spline.setCurveHandle(curveHandle, curveHandleSize);
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterParametricBorder.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterParametricBorder.java
index 5c5c0b496..3d6954691 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterParametricBorder.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterParametricBorder.java
@@ -82,8 +82,8 @@ public class ImageFilterParametricBorder extends ImageFilter {
border.moveTo(0, 0);
int w = bitmap.getWidth();
int h = bitmap.getHeight();
- float bs = mBorderSize * scaleFactor;
- float r = mBorderCornerRadius * scaleFactor;
+ float bs = mBorderSize / 100.0f * bitmap.getWidth();
+ float r = mBorderCornerRadius / 100.0f * bitmap.getWidth();
border.lineTo(0, h);
border.lineTo(w, h);
border.lineTo(w, 0);