Skip to content

Commit

Permalink
Fixing greedy digits lookup in animation sprites file paths
Browse files Browse the repository at this point in the history
Fixes quinton-ashley#197 . This is a tiny mergeable variant of PR https://github.com/molleindustria/p5.play/pull/175 which covers other things.
  • Loading branch information
myselfhimself committed May 27, 2021
1 parent 6b55830 commit 024d59e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/p5.play.js
Original file line number Diff line number Diff line change
Expand Up @@ -3443,11 +3443,15 @@ function Animation(pInst) {
for (i = from.length-4; i >= 0; i--) {
if(from.charAt(i) >= '0' && from.charAt(i) <= '9')
digits1++;
else
break;
}

for (i = to.length-4; i >= 0; i--) {
if(to.charAt(i) >= '0' && to.charAt(i) <= '9')
digits2++;
else
break;
}

var prefix1 = from.substring(0, from.length-(4+digits1));
Expand Down

0 comments on commit 024d59e

Please sign in to comment.