Permalink
Browse files

opts.padding

  • Loading branch information...
1 parent 8889bb9 commit d1020ea069245fae7909f0de43a4e2dfe121bc6e @substack committed Oct 2, 2012
Showing with 4 additions and 3 deletions.
  1. +3 −2 index.js
  2. +1 −1 package.json
View
@@ -7,12 +7,13 @@ module.exports = function art (src, opts) {
if (!opts.width) opts.width = 6;
if (!opts.colors) opts.colors = {};
if (!opts.left) opts.left = 0;
+ if (!opts.padding) opts.padding = 50;
if (Array.isArray(src)) {
var size = src.slice(1).reduce(function (acc, s) {
var size = imageSize(s, opts);
return {
- width : acc.width + size.width + 50,
+ width : acc.width + size.width + opts.padding,
height : Math.max(acc.height, size.height),
};
}, imageSize(src[0], opts));
@@ -25,7 +26,7 @@ module.exports = function art (src, opts) {
draw(canvas, s, opts);
var size = imageSize(s, opts);
- left += size.width + 50;
+ left += size.width + opts.padding;
});
return canvas.createPNGStream();
View
@@ -1,6 +1,6 @@
{
"name" : "code-art",
- "version" : "0.0.0",
+ "version" : "0.1.0",
"description" : "create blocky modern art from code",
"main" : "index.js",
"directories" : {

0 comments on commit d1020ea

Please sign in to comment.