diff options
author | John Hoford <hoford@google.com> | 2013-02-12 13:42:19 -0800 |
---|---|---|
committer | John Hoford <hoford@google.com> | 2013-02-12 13:43:29 -0800 |
commit | bd4c46989171b5171797e0dbf4b33a1914ffba49 (patch) | |
tree | 418368856e8e07bc2cae703bc9d6122fc8e7bca3 /src | |
parent | 1c00e97c214dc8c0a73f02b9faec53ce02d81b54 (diff) | |
download | android_packages_apps_Snap-bd4c46989171b5171797e0dbf4b33a1914ffba49.tar.gz android_packages_apps_Snap-bd4c46989171b5171797e0dbf4b33a1914ffba49.tar.bz2 android_packages_apps_Snap-bd4c46989171b5171797e0dbf4b33a1914ffba49.zip |
fix the draw clear bug
Change-Id: I1050c3e1ad1280480f35a03c9d29dc1cd44b515f
Diffstat (limited to 'src')
3 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/filtershow/editors/EditorDraw.java b/src/com/android/gallery3d/filtershow/editors/EditorDraw.java index 907d1083e..aa5ec61e8 100644 --- a/src/com/android/gallery3d/filtershow/editors/EditorDraw.java +++ b/src/com/android/gallery3d/filtershow/editors/EditorDraw.java @@ -121,8 +121,8 @@ public class EditorDraw extends Editor { ImageDraw idraw = (ImageDraw) mImageShow; idraw.setStyle(ImageFilterDraw.SIMPLE_STYLE); } else if (item.getItemId() == R.id.draw_menu_clear) { - FilterDrawRepresentation drawRep = (FilterDrawRepresentation) getLocalRepresentation(); - drawRep.clear(); + ImageDraw idraw = (ImageDraw) mImageShow; + idraw.resetParameter(); commitLocalRepresentation(); } mView.invalidate(); diff --git a/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java index 89ea5ccc5..e41f0a622 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterDrawRepresentation.java @@ -94,7 +94,10 @@ public class FilterDrawRepresentation extends FilterRepresentation { } if (representation.mDrawing != null) { mDrawing = (Vector<StrokeData>) representation.mDrawing.clone(); + } else { + mDrawing = null; } + } catch (CloneNotSupportedException e) { e.printStackTrace(); } diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java index 9d22f7a6f..9fa4ce97e 100644 --- a/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java +++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterDraw.java @@ -224,7 +224,8 @@ public class ImageFilterDraw extends ImageFilter { if (mOverlayBitmap == null || mOverlayBitmap.getWidth() != canvas.getWidth() || - mOverlayBitmap.getHeight() != canvas.getHeight()) { + mOverlayBitmap.getHeight() != canvas.getHeight() || + mParameters.getDrawing().size() < mCachedStrokes) { mOverlayBitmap = Bitmap.createBitmap( canvas.getWidth(), canvas.getHeight(), Bitmap.Config.ARGB_8888); |