aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-05-16 11:28:10 -0400
committerbobzel <zzzman@gmail.com>2024-05-16 11:28:10 -0400
commit41e47a7b7789e8c192fb31188cf549178ec71a22 (patch)
treec94ee8ab0e952d633f21483ec8e450a471d2c925 /src/client/views/nodes/CollectionFreeFormDocumentView.tsx
parentfdd0e62c148fde01c82504700a83fcc56463a68d (diff)
moved isHovering to DocumentView as instance variable instead from FormattedText as a Document field. cleaned up cluster style provider. fixed freeformView to not trigger as many updates when a doc is dropped, and fixed layoutEngines to not return a background or color unless actually set by the engine.
Diffstat (limited to 'src/client/views/nodes/CollectionFreeFormDocumentView.tsx')
-rw-r--r--src/client/views/nodes/CollectionFreeFormDocumentView.tsx13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
index 62c4cc61a..d65e2d65e 100644
--- a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
+++ b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
@@ -126,15 +126,16 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
PanelHeight = () => this._props.autoDim ? this._props.PanelHeight?.() : this.Height; // prettier-ignore
styleProvider = (doc: Doc | undefined, props: Opt<FieldViewProps>, property: string) => {
- if (doc === this.layoutDoc) {
+ const overrideProp = () => {
switch (property.split(':')[0]) {
- case StyleProp.Opacity: return this.Opacity; // only change the opacity for this specific document, not its children
+ case StyleProp.Opacity: return this.Opacity;
case StyleProp.BackgroundColor: return this.BackgroundColor;
case StyleProp.Color: return this.Color;
- default:
- } // prettier-ignore
- }
- return this._props.styleProvider?.(doc, props, property);
+ default: return undefined;
+ }}; // prettier-ignore
+
+ // only override values for this specific document, not any children
+ return (doc === this.layoutDoc && overrideProp()) ?? this._props.styleProvider?.(doc, props, property);
};
public static getValues(doc: Doc, time: number, fillIn: boolean = true) {