diff options
author | nicolasroard <nicolasroard@google.com> | 2013-08-15 15:35:53 -0700 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2013-08-15 15:35:53 -0700 |
commit | 3cd6fc8e632e406628b5977ee47c191523552500 (patch) | |
tree | 5c0f228e1f81fec67a5f3c20dc7856d7419f5397 /src/com/android/gallery3d | |
parent | f904939a3613902d4a0cc06741a00377bb55d44b (diff) | |
download | android_packages_apps_Gallery2-3cd6fc8e632e406628b5977ee47c191523552500.tar.gz android_packages_apps_Gallery2-3cd6fc8e632e406628b5977ee47c191523552500.tar.bz2 android_packages_apps_Gallery2-3cd6fc8e632e406628b5977ee47c191523552500.zip |
Fix copies / undo manager issues in filters
Change-Id: Icc7671ccfe52a2519ad8f4833e746768ec97cff8
Diffstat (limited to 'src/com/android/gallery3d')
3 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java index d90dd61a3..61f7e683d 100644 --- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java +++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java @@ -596,6 +596,7 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL ImagePreset copy = new ImagePreset(oldPreset); FilterRepresentation representation = copy.getRepresentation(filterRepresentation); if (representation == null) { + filterRepresentation = filterRepresentation.copy(); copy.addFilter(filterRepresentation); } else if (filterRepresentation.getFilterType() == FilterRepresentation.TYPE_GEOMETRY) { representation.useParametersFrom(filterRepresentation); diff --git a/src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java index 42a7406bc..8429d3b5e 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java @@ -51,6 +51,11 @@ public class FilterVignetteRepresentation extends FilterBasicRepresentation impl } @Override + public String toString() { + return getName() + " : " + mCenterX + ", " + mCenterY + " radius: " + mRadiusX; + } + + @Override public FilterRepresentation copy() { FilterVignetteRepresentation representation = new FilterVignetteRepresentation(); copyAllParameters(representation); diff --git a/src/com/android/gallery3d/filtershow/history/HistoryItem.java b/src/com/android/gallery3d/filtershow/history/HistoryItem.java index 2baaac327..80da3309f 100644 --- a/src/com/android/gallery3d/filtershow/history/HistoryItem.java +++ b/src/com/android/gallery3d/filtershow/history/HistoryItem.java @@ -28,7 +28,7 @@ public class HistoryItem { private Bitmap mPreviewImage; public HistoryItem(ImagePreset preset, FilterRepresentation representation) { - mImagePreset = new ImagePreset(preset); + mImagePreset = preset; // just keep a pointer to the current preset if (representation != null) { mFilterRepresentation = representation.copy(); } |