Add defaults for 'tags' and 'text' properties

master
Sven Slootweg 7 years ago
parent 74dd184f76
commit 19c1a1d18f

@ -11,7 +11,7 @@ function getTextProperties(item) {
return objectPick(item, ["fontSize", "fontFamily", "fontStyle", "fontWeight", "fillColor", "strokeColor"]); 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({ let textObject = canvassed.createObject(Object.assign({
_layout: null, _layout: null,
_lines: null, _lines: null,
@ -25,6 +25,8 @@ module.exports = function createTextShape(options) {
fontSize: 16, fontSize: 16,
fontWeight: "normal", fontWeight: "normal",
lineHeight: 1.16, lineHeight: 1.16,
tags: false,
text: "",
onRender: function onRender(context) { onRender: function onRender(context) {
if (this.renderDebugArea) { if (this.renderDebugArea) {
context.fillStyle = "silver"; context.fillStyle = "silver";

Loading…
Cancel
Save