From 41e47a7b7789e8c192fb31188cf549178ec71a22 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 16 May 2024 11:28:10 -0400
Subject: 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.

---
 src/client/views/nodes/CollectionFreeFormDocumentView.tsx | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

(limited to 'src/client/views/nodes/CollectionFreeFormDocumentView.tsx')

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) {
-- 
cgit v1.2.3-70-g09d2

