From c12659816adf68bb0bb931e97096afa82bfbe769 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 18 Jan 2024 17:46:40 -0500
Subject: fix so that freeformviews don't break when they have annotation layer
 children.

---
 .../collectionFreeForm/CollectionFreeFormView.tsx          | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

(limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index a8f22aaae..c0104d0f8 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1751,13 +1751,6 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
         this.childDocs.some(doc => !this._renderCutoffData.get(doc[Id])) && setTimeout(this.incrementalRender, 1);
     });
 
-    // if a freeform view has any children, then the children will likely consist of a single child
-    // which will be a DocumentView.  In this sitation, this freeform views acts as an annotation overlay for
-    // the underlying DocumentView and will pan and scoll with the underlying Documen tView.
-    @computed get underlayViews() {
-        return this._props.children ? this._props.children : [];
-    }
-
     @computed get placeholder() {
         return (
             <div className="collectionfreeformview-placeholder" style={{ background: this._props.styleProvider?.(this.Document, this._props, StyleProp.BackgroundColor) }}>
@@ -1790,7 +1783,7 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
             </div>
         );
     }
-    @computed get pannableContents() {
+    get pannableContents() {
         this.incrementalRender();
         return (
             <CollectionFreeFormPannableContents
@@ -1800,14 +1793,13 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
                 transform={this.PanZoomCenterXf}
                 transition={this._panZoomTransition ? `transform ${this._panZoomTransition}ms` : Cast(this.layoutDoc._viewTransition, 'string', Cast(this.Document._viewTransition, 'string', null))}
                 viewDefDivClick={this._props.viewDefDivClick}>
-                {this.underlayViews}
+                {this.props.children ?? null} {/* most likely case of children is document content that's being annoated: eg., an image */}
                 {this.contentViews}
                 <CollectionFreeFormRemoteCursors {...this._props} key="remoteCursors" />
             </CollectionFreeFormPannableContents>
         );
     }
-    @computed get marqueeView() {
-        TraceMobx();
+    get marqueeView() {
         return (
             <MarqueeView
                 {...this._props}
-- 
cgit v1.2.3-70-g09d2

