diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/DataVizBox/DocCreatorMenu/FieldTypes.tsx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/FieldTypes.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu/FieldTypes.tsx index 073822fa8..8b288b269 100644 --- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/FieldTypes.tsx +++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/FieldTypes.tsx @@ -101,6 +101,7 @@ class Field { applyBasicOpts = (doc: Doc) => { const opts = this.settings.opts; + doc.isDefaultTemplateDoc = true, doc.x = this.dimensions.coord.x; doc.y = this.dimensions.coord.y; doc._height = this.dimensions.height; @@ -111,11 +112,13 @@ class Field { doc.borderWidth = opts.borderWidth; doc.opacity = opts.opacity; doc._rotation = opts.rotation; + doc.hCentering = opts.contentXCentering; } } class TextField extends Field implements ConstructedField<string> { content: string = ''; + fontSize: string = '10'; constructor(settings: FieldSettings, parent: Field) { super(settings, parent); @@ -128,12 +131,15 @@ class TextField extends Field implements ConstructedField<string> { contentBold: opts.fontBold, textTransform: opts.fontTransform, color: opts.color, + _text_fontSize: `${this.calculateFontSize(this.dimensions.width, this.dimensions.height, this.content, true)}` }); this.applyBasicOpts(doc); return doc; } validSubfieldGroups = () => { + + return []; } @@ -141,8 +147,8 @@ class TextField extends Field implements ConstructedField<string> { this.content = newContent; } - getContent = () => { - return ''; + getContent() { + return this.content; }; } |