Skip to content

Commit

Permalink
Add background color option.
Browse files Browse the repository at this point in the history
  • Loading branch information
lacek committed Apr 26, 2014
1 parent 80f7aa7 commit 7236464
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
"charSpacingRatio": 0,

"lineSpacingRatio": 0.1,

"backgroundColor": "#FFFFFF",

"maxFileNameLength": 50
}
4 changes: 4 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ function drawImage() {
var x = 0, y = 0, row = 0;
rowHeight = 0;
var context = canvas.getContext("2d");
if (config.backgroundColor) {
context.fillStyle = config.backgroundColor;
context.fillRect(0, 0, width, height);
}
var maxRowWidth = Math.max.apply(Math, rowWidths);
if (rowWidths[0] < maxRowWidth) {
switch (config.charHorizontalAlign) {
Expand Down

0 comments on commit 7236464

Please sign in to comment.