diff options
| author | Tim Redfern <tim@getdrop.com> | 2017-10-29 17:18:25 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2017-10-29 17:18:25 +0000 |
| commit | 1d2e4b56b0104b36da79b3fa5762645e85ccea3a (patch) | |
| tree | 55fa295de568fffd3e4560a7aef27080383265c1 | |
| parent | 746cf395f21451c41af6ac97e318e84dc4dcf3e2 (diff) | |
last minute fixes
| -rw-r--r-- | gui/src/chainImageSet.cpp | 76 | ||||
| -rw-r--r-- | gui/src/chainImageSet.h | 2 |
2 files changed, 40 insertions, 38 deletions
diff --git a/gui/src/chainImageSet.cpp b/gui/src/chainImageSet.cpp index 65d2ed4..9f2cfcc 100644 --- a/gui/src/chainImageSet.cpp +++ b/gui/src/chainImageSet.cpp @@ -273,46 +273,48 @@ void chainImageSet::keyPressed(ofKeyEventArgs &keyargs){ (*selected)->linkPos.x++; break; case OF_KEY_BACKSPACE:{ - if (images.size()==1||keyargs.modifiers==2){ - //ctrl-backspace to delete whole bank - //also OF_KEY_DEL ? - images.clear(); - filename.clear(); - break; - } + if (images.size()){ + 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()){ - previous=images.end(); - previous--; - } - else { - previous--; - } + bool setCurrent=false; + if (currentImage==selected){ + //we are deleting the playing image + setCurrent=true; + } + + auto previous=selected; + if (previous==images.begin()){ + previous=images.end(); + previous--; + } + else { + previous--; + } - auto next=selected; - next++; - if (next==images.end()){ - next=images.begin(); - } + auto next=selected; + next++; + if (next==images.end()){ + next=images.begin(); + } - (*previous)->link=(*selected)->link; - (*next)->linked=&(*(*previous)) ; - images.erase(selected); - selected=previous; - selected++; - if (selected==images.end()){ - selected=images.begin(); - } - if (setCurrent){ - //we have just deleted the playing image - currentImage=selected; + (*previous)->link=(*selected)->link; + (*next)->linked=&(*(*previous)) ; + images.erase(selected); + selected=previous; + selected++; + if (selected==images.end()){ + selected=images.begin(); + } + if (setCurrent){ + //we have just deleted the playing image + currentImage=selected; + } } break; diff --git a/gui/src/chainImageSet.h b/gui/src/chainImageSet.h index 1cc44cd..879329a 100644 --- a/gui/src/chainImageSet.h +++ b/gui/src/chainImageSet.h @@ -13,7 +13,7 @@ class chainImageSet{ currentDefaultImageRatio=0.3; filename=""; outputSize=ofPoint(1024,576); - decayFactor=.999; + decayFactor=.9999; additive=false; intensity=1.0f; fitFactor=0.9f; |
