summaryrefslogtreecommitdiff
path: root/gui/src/chainImageSet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/src/chainImageSet.cpp')
-rw-r--r--gui/src/chainImageSet.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/gui/src/chainImageSet.cpp b/gui/src/chainImageSet.cpp
index 252e4e6..7af446f 100644
--- a/gui/src/chainImageSet.cpp
+++ b/gui/src/chainImageSet.cpp
@@ -260,13 +260,19 @@ void chainImageSet::keyPressed(ofKeyEventArgs &keyargs){
(*selected)->linkPos.x++;
break;
case OF_KEY_BACKSPACE:{
-
- if (images.size()==1){
+ if (images.size()==1||keyargs.modifiers==2){
+ //ctrl-backspace to delete whole bank
//also OF_KEY_DEL ?
images.clear();
filename.clear();
break;
}
+
+ bool setCurrent=false;
+ if (currentImage==selected){
+ //we are deleting the playing image
+ setCurrent=true;
+ }
auto previous=selected;
if (previous==images.begin()){
@@ -277,16 +283,16 @@ void chainImageSet::keyPressed(ofKeyEventArgs &keyargs){
previous--;
}
(*previous)->link=(*selected)->link;
- printf("DELETING: %s \n",(*selected)->filename.c_str());
- printf("LINKING %s to %s\n",(*previous)->filename.c_str(),(*selected)->link->filename.c_str());
images.erase(selected);
- //printf("%s is now selected\n",(*selected)->filename.c_str()); //crashes
selected=previous;
selected++;
if (selected==images.end()){
selected=images.begin();
}
- printf("%s is set selected\n",(*selected)->filename.c_str());
+ if (setCurrent){
+ //we have just deleted the playing image
+ currentImage=selected;
+ }
break;