diff options
| author | John Hoford <hoford@google.com> | 2013-08-13 19:06:35 -0700 |
|---|---|---|
| committer | John Hoford <hoford@google.com> | 2013-08-13 19:06:35 -0700 |
| commit | d3ca24707a0a0ab019dec0a17b0d540b685e459a (patch) | |
| tree | 855180dff56a42cfda1393373b3d1f066ea4ed73 /src | |
| parent | 9977d45fcae932581c1788cf3fa96a3f4040a8dc (diff) | |
| download | android_packages_apps_Gallery2-d3ca24707a0a0ab019dec0a17b0d540b685e459a.tar.gz android_packages_apps_Gallery2-d3ca24707a0a0ab019dec0a17b0d540b685e459a.tar.bz2 android_packages_apps_Gallery2-d3ca24707a0a0ab019dec0a17b0d540b685e459a.zip | |
add solid round mode to draw
Change-Id: I60249711602fa3aaf2bce0b5035e75f746caa5eb
Diffstat (limited to 'src')
3 files changed, 15 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/filtershow/editors/EditorDraw.java b/src/com/android/gallery3d/filtershow/editors/EditorDraw.java index b3fa3f7b8..9ffd4c44b 100644 --- a/src/com/android/gallery3d/filtershow/editors/EditorDraw.java +++ b/src/com/android/gallery3d/filtershow/editors/EditorDraw.java @@ -48,6 +48,7 @@ public class EditorDraw extends ParametricEditor implements FilterView { private static final int MODE_STYLE = FilterDrawRepresentation.PARAM_STYLE; int[] brushIcons = { R.drawable.brush_flat, + R.drawable.brush_round, R.drawable.brush_gauss, R.drawable.brush_marker, R.drawable.brush_spatter diff --git a/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java index d55fa6d14..cdbbcef58 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java @@ -51,7 +51,7 @@ public class FilterDrawRepresentation extends FilterRepresentation { private BasicParameterInt mParamBrightness = new ParameterBrightness(PARAM_BRIGHTNESS, 220); private BasicParameterInt mParamSaturation = new ParameterSaturation(PARAM_SATURATION, 200); private ParameterOpacity mParamOpacity = new ParameterOpacity(PARAM_OPACITY, 200); - private BasicParameterStyle mParamStyle = new BasicParameterStyle(PARAM_STYLE, 4); + private BasicParameterStyle mParamStyle = new BasicParameterStyle(PARAM_STYLE, 5); int mParamMode; Parameter mCurrentParam = mParamSize; private static final String SERIAL_COLOR = "color"; @@ -235,7 +235,7 @@ public class FilterDrawRepresentation extends FilterRepresentation { sd.mRadius = size; sd.mType = type; } - + public void startNewSection(float x, float y) { mCurrent = new StrokeData(); fillStrokeParameters(mCurrent); diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java index e4a461573..6a0ce5719 100644 --- a/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java +++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java @@ -53,7 +53,8 @@ public class ImageFilterDraw extends ImageFilter { } DrawStyle[] mDrawingsTypes = new DrawStyle[] { - new SimpleDraw(), + new SimpleDraw(0), + new SimpleDraw(1), new Brush(R.drawable.brush_gauss), new Brush(R.drawable.brush_marker), new Brush(R.drawable.brush_spatter) @@ -92,6 +93,11 @@ public class ImageFilterDraw extends ImageFilter { class SimpleDraw implements DrawStyle { byte mType; + int mMode; + + public SimpleDraw(int mode) { + mMode = mode; + } @Override public void setType(byte type) { @@ -110,6 +116,11 @@ public class ImageFilterDraw extends ImageFilter { Paint paint = new Paint(); paint.setStyle(Style.STROKE); + if (mMode == 0) { + paint.setStrokeCap(Paint.Cap.SQUARE); + } else { + paint.setStrokeCap(Paint.Cap.ROUND); + } paint.setAntiAlias(true); paint.setColor(sd.mColor); paint.setStrokeWidth(toScrMatrix.mapRadius(sd.mRadius)); |
