From 19c1a1d18f8e50387651aec0df72fab8f5e93b54 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 12 Mar 2017 23:15:38 +0100 Subject: [PATCH] Add defaults for 'tags' and 'text' properties --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index f4c43e3..a359b3c 100644 --- a/src/index.js +++ b/src/index.js @@ -11,7 +11,7 @@ function getTextProperties(item) { return objectPick(item, ["fontSize", "fontFamily", "fontStyle", "fontWeight", "fillColor", "strokeColor"]); } -module.exports = function createTextShape(options) { +module.exports = function createTextShape(options = {}) { let textObject = canvassed.createObject(Object.assign({ _layout: null, _lines: null, @@ -25,6 +25,8 @@ module.exports = function createTextShape(options) { fontSize: 16, fontWeight: "normal", lineHeight: 1.16, + tags: false, + text: "", onRender: function onRender(context) { if (this.renderDebugArea) { context.fillStyle = "silver";