From d0ee23b95aef2b57eb8d02d8441568c2f6ba2a14 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 1 Sep 2020 13:08:18 -0400
Subject: fixed locking document to set nativewidth/height correctly

---
 src/client/views/nodes/DocumentView.tsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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

diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 2f2a324c8..0182e652f 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -709,8 +709,10 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
         this.Document._overflow = this.Document._isBackground ? "visible" : undefined;
         if (this.Document._isBackground) {
             this.props.bringToFront(this.props.Document, true);
-            this.props.Document[DataSym][Doc.LayoutFieldKey(this.Document) + "-nativeWidth"] = this.Document[WidthSym]();
-            this.props.Document[DataSym][Doc.LayoutFieldKey(this.Document) + "-nativeHeight"] = this.Document[HeightSym]();
+            const wid = this.Document[WidthSym]();    // change the nativewidth and height if the background is to be a collection that aggregates stuff that is added to it.
+            const hgt = this.Document[HeightSym]();
+            this.props.Document[DataSym][Doc.LayoutFieldKey(this.Document) + "-nativeWidth"] = wid;
+            this.props.Document[DataSym][Doc.LayoutFieldKey(this.Document) + "-nativeHeight"] = hgt;
         }
     }
 
-- 
cgit v1.2.3-70-g09d2

