Skip to content

Commit

Permalink
Fixed #5. Fixed issue, when there are more elements than predifened b…
Browse files Browse the repository at this point in the history
…g's.
  • Loading branch information
George Yakovlev committed Nov 27, 2017
1 parent 90cc917 commit bebed0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions js/jquery.letterpic.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
function BgProvider(settings, bgs, drawBgFunc) {
var provider = this;
provider.bgs = bgs;
var bgs = provider.bgs.slice().reverse();
var bgs = [];

provider.draw = function($canvas, key, text) {

Expand Down Expand Up @@ -113,8 +113,8 @@
self.cache[fill] = {};
}
if(!self.cache[fill][key]) {
if(!bgs.length)
colors = provider.bgs.slice().reverse();
if(bgs.length === 0)
bgs = provider.bgs.slice().reverse();
bg = bgs.pop();
self.cache[fill][key] = bg;
}
Expand Down
2 changes: 1 addition & 1 deletion js/jquery.letterpic.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bebed0c

Please sign in to comment.