summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolasroard <nicolasroard@google.com>2013-08-15 15:41:35 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-08-15 15:41:35 -0700
commit0d01810843df9225ae0cd9cae2bc7c0339c0864a (patch)
tree52df24689ee02f34cdedcfa3e8415e18a11eb80e
parentc2b0954986b033859be9e8f3278d7a5abedae53f (diff)
parent3cd6fc8e632e406628b5977ee47c191523552500 (diff)
downloadandroid_packages_apps_Gallery2-0d01810843df9225ae0cd9cae2bc7c0339c0864a.tar.gz
android_packages_apps_Gallery2-0d01810843df9225ae0cd9cae2bc7c0339c0864a.tar.bz2
android_packages_apps_Gallery2-0d01810843df9225ae0cd9cae2bc7c0339c0864a.zip
am 3cd6fc8e: Fix copies / undo manager issues in filters
* commit '3cd6fc8e632e406628b5977ee47c191523552500': Fix copies / undo manager issues in filters
-rw-r--r--src/com/android/gallery3d/filtershow/FilterShowActivity.java1
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterVignetteRepresentation.java5
-rw-r--r--src/com/android/gallery3d/filtershow/history/HistoryItem.java2
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();
}