diff options
author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2025-05-12 07:26:51 -0400 |
---|---|---|
committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2025-05-12 07:26:51 -0400 |
commit | 03d1cd8d220fbb27acb49a3ff9e791db9292b83c (patch) | |
tree | 54e6d0f434fa88f5d5cdd5c5c16ebeade739c2c4 /src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.ts | |
parent | 259aaed6bdb77872c40d5c1ea63af741eb52fd4c (diff) |
c
Diffstat (limited to 'src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.ts')
-rw-r--r-- | src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.ts | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.ts b/src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.ts index 1889e4984..232a9cf67 100644 --- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.ts +++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/Template.ts @@ -137,7 +137,34 @@ export class Template { }); } - this._mainField.makeBackgroundField(field) + this._mainField.makeBackgroundField(field); + } + + /** + * This function is just a hack for now to get around weird document icon stuff (specifically it misses the background) + */ + setMatteBackground(makeTransparent: boolean = false) { + if (this._mainField.hasBackground) { + return; + } + + const fieldSettings: FieldSettings = { + tl: [-1, -1], + br: [1, 1], + opts: {backgroundColor: String(this._mainField.renderedDoc!.backgroundColor)}, + viewType: ViewType.TEXT, + } + + const field: TemplateField = TemplateField.CreateField(fieldSettings, Math.random() * 100 + 100, this._mainField); + + if (makeTransparent) { + this.allFields.forEach(field => { + field.updateDocSetting('backgroundColor', 'transparent'); + field.updateDocSetting('borderWidth', '0'); + }); + } + + this._mainField.makeBackgroundField(field); } getMatches = (cols: Col[]): number[][] => { |