From 93c50b6ea3b24994d836ad24c8476c9f9012a089 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 8 Oct 2020 21:57:50 -0400
Subject: added direct typing of notes into stacking columns in text box
 sidebar.

---
 src/client/views/collections/CollectionStackingViewFieldColumn.tsx | 6 ++++++
 1 file changed, 6 insertions(+)

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

diff --git a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
index 1bc989e83..74ea824cd 100644
--- a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
+++ b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
@@ -130,6 +130,11 @@ export class CollectionStackingViewFieldColumn extends React.Component<CSVFieldC
         this._background = "inherit";
     }
 
+    @action
+    textCallback = (char: string) => {
+        return this.addDocument(char, false);
+    }
+
     @action
     addDocument = (value: string, shiftDown?: boolean) => {
         if (!value) return false;
@@ -300,6 +305,7 @@ export class CollectionStackingViewFieldColumn extends React.Component<CSVFieldC
         const newEditableViewProps = {
             GetValue: () => "",
             SetValue: this.addDocument,
+            textCallback: this.textCallback,
             contents: "+ NEW",
             HeadingObject: this.props.headingObject,
             toggle: this.toggleVisibility,
-- 
cgit v1.2.3-70-g09d2


From c150d0afa46c2c45e413a5269d26bc46b64ba765 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 8 Oct 2020 23:21:04 -0400
Subject: fixed dragging bottom of some pdfs not to grow wildly.  stopped
 writing renderContentBounds to annotation views.  fixed texts sidebar notes
 to not add extra chars on creation.

---
 src/client/views/DocumentDecorations.tsx                          | 2 +-
 .../views/collections/CollectionStackingViewFieldColumn.tsx       | 8 ++++----
 .../collections/collectionFreeForm/CollectionFreeFormView.tsx     | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

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

diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 066cfd95a..66f0dd99d 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -450,7 +450,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
                 height = !height || isNaN(height) ? 20 : height;
                 const scale = docView.props.ScreenToLocalTransform().Scale * docView.props.ContentScaling();
                 if (nwidth && nheight) {
-                    if (nwidth / nheight !== width / height) {
+                    if (nwidth / nheight !== width / height && !dragBottom) {
                         height = nheight / nwidth * width;
                     }
                     if (e.ctrlKey || (!dragBottom || !docView.layoutDoc._fitWidth)) { // ctrl key enables modification of the nativeWidth or nativeHeight durin the interaction
diff --git a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
index 74ea824cd..b7562c45e 100644
--- a/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
+++ b/src/client/views/collections/CollectionStackingViewFieldColumn.tsx
@@ -132,12 +132,12 @@ export class CollectionStackingViewFieldColumn extends React.Component<CSVFieldC
 
     @action
     textCallback = (char: string) => {
-        return this.addDocument(char, false);
+        return this.addDocument("", false, true);
     }
 
     @action
-    addDocument = (value: string, shiftDown?: boolean) => {
-        if (!value) return false;
+    addDocument = (value: string, shiftDown?: boolean, forceEmptyNote?: boolean) => {
+        if (!value && !forceEmptyNote) return false;
         const key = StrCast(this.props.parent.props.Document._pivotField);
         const newDoc = Docs.Create.TextDocument(value, { _height: 18, _width: 200, title: value, _autoHeight: true });
         newDoc[key] = this.getValue(this.props.heading);
@@ -145,7 +145,7 @@ export class CollectionStackingViewFieldColumn extends React.Component<CSVFieldC
         const heading = maxHeading === 0 || this.props.docList.length === 0 ? 1 : maxHeading === 1 ? 2 : 3;
         newDoc.heading = heading;
         FormattedTextBox.SelectOnLoad = newDoc[Id];
-        FormattedTextBox.SelectOnLoadChar = " ";
+        FormattedTextBox.SelectOnLoadChar = forceEmptyNote ? "" : " ";
         return this.props.parent.props.addDocument(newDoc);
     }
 
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 5236fab27..796765a8d 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1441,7 +1441,7 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P
     render() {
         TraceMobx();
         const clientRect = this._mainCont?.getBoundingClientRect();
-        !this.fitToContent && this._layoutElements?.length && setTimeout(() => this.Document._renderContentBounds = new List<number>([this.contentBounds.x, this.contentBounds.y, this.contentBounds.r, this.contentBounds.b]), 0);
+        !this.fitToContent && !this.props.annotationsKey && this._layoutElements?.length && setTimeout(() => this.Document._renderContentBounds = new List<number>([this.contentBounds.x, this.contentBounds.y, this.contentBounds.r, this.contentBounds.b]), 0);
         return <div className={"collectionfreeformview-container"} ref={this.createDashEventsTarget}
             onPointerOver={this.onPointerOver}
             onWheel={this.onPointerWheel}
-- 
cgit v1.2.3-70-g09d2

