From 9a9c3b582a407f632aaaa8e704113262796757f4 Mon Sep 17 00:00:00 2001 From: nicolasroard Date: Tue, 23 Oct 2012 14:09:53 -0700 Subject: Express the borders size in percentages bug:7379459 Change-Id: I14c91dbee0480a3880a11b166fcce3673c2ff3eb --- src/com/android/gallery3d/filtershow/FilterShowActivity.java | 3 +-- .../gallery3d/filtershow/filters/ImageFilterParametricBorder.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src') 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); -- cgit v1.2.3