From 5c24f945645c176782077642abdb2c10fb98e8f1 Mon Sep 17 00:00:00 2001 From: Andreas Borg <communic@tion.to> Date: Thu, 12 Jun 2014 14:52:20 -0400 Subject: [PATCH] Update ofxSprite.cpp --- ofxSprite.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ofxSprite.cpp b/ofxSprite.cpp index 65ad224..c8cde49 100644 --- a/ofxSprite.cpp +++ b/ofxSprite.cpp @@ -138,8 +138,12 @@ void ofxSprite::draw(ofVec2f v) { ofImage& ofxSprite::getImageAtFrame(int frame) { assert(totalFrames); - if (frame<=totalFrames) return assets[filenames[frame]]; - else return assets[filenames[0]]; + //borg: out of bounds issue fix here + if (frame<totalFrames){ + return assets[filenames[frame]]; + }else{ + return assets[filenames[0]]; + } } ofImage& ofxSprite::getCurrentImage() {