From f5b04341893da68e50b0cbc72d77795209bfee3e Mon Sep 17 00:00:00 2001
From: eleanor-park <eleanor_park@brown.edu>
Date: Tue, 27 Aug 2024 20:43:24 -0400
Subject: still trying to resolve merge issues

---
 src/client/views/InkTranscription.tsx | 42 +++++++++++++++++++++++++++--------
 1 file changed, 33 insertions(+), 9 deletions(-)

(limited to 'src/client/views/InkTranscription.tsx')

diff --git a/src/client/views/InkTranscription.tsx b/src/client/views/InkTranscription.tsx
index 0735aa6d2..485a0e7c4 100644
--- a/src/client/views/InkTranscription.tsx
+++ b/src/client/views/InkTranscription.tsx
@@ -114,6 +114,7 @@ export class InkTranscription extends React.Component {
         const validInks = inkDocs.filter(s => s.type === DocumentType.INK);
 
         const strokes: InkData[] = [];
+
         const times: number[] = [];
         validInks
             .filter(i => Cast(i[Doc.LayoutFieldKey(i)], InkField))
@@ -124,8 +125,22 @@ export class InkTranscription extends React.Component {
                 times.push(DateCast(i.author_date).getDate().getTime());
             });
         console.log(strokes);
-        console.log(this.convertPointsToString(strokes));
-        console.log(this.convertPointsToString2(strokes));
+        console.log(
+            `this.Multistrokes.push(
+            new Multistroke(
+                Gestures.Scribble,
+                useBoundedRotationInvariance,
+                new Array([
+                    ` +
+                this.convertPointsToString(strokes) +
+                `
+                ])
+            )
+        )
+        `
+        );
+        //console.log(this.convertPointsToString(strokes));
+        //console.log(this.convertPointsToString2(strokes));
         this.currGroup = groupDoc;
         const pointerData = strokes.map((stroke, i) => this.inkJSON(stroke, times[i]));
         const processGestures = false;
@@ -137,7 +152,7 @@ export class InkTranscription extends React.Component {
         }
     };
     convertPointsToString(points: InkData[]): string {
-        return points[0].map(point => `new Point(${point.X}, ${point.Y})`).join(',\n                    ');
+        return points[0].map(point => `new Point(${point.X}, ${point.Y})`).join(',');
     }
     convertPointsToString2(points: InkData[]): string {
         return points[0].map(point => `(${point.X},${point.Y})`).join(',');
@@ -312,11 +327,20 @@ export class InkTranscription extends React.Component {
         }
     };
 
-//                 if (this.currGroup) {
-//                     this.currGroup.text = text;  // transcription text
-//                     this.currGroup.icon_fieldKey = 'transcription'; // use the transcription icon template when iconifying
-//                     this.currGroup.title = text.split('\n')[0];
-//                 }
+    /**
+     * Creates the ink grouping once the user leaves the writing mode.
+     */
+    createInkGroup() {
+        // TODO nda - if document being added to is a inkGrouping then we can just add to that group
+        if (Doc.ActiveTool === InkTool.Write) {
+            CollectionFreeFormView.collectionsWithUnprocessedInk.forEach(ffView => {
+                // TODO: nda - will probably want to go through ffView unprocessed docs and then see if any of the inksToGroup docs are in it and only use those
+                const selected = ffView.unprocessedDocs;
+                const newCollection = this.groupInkDocs(
+                    selected.filter(doc => doc.embedContainer),
+                    ffView
+                );
+                ffView.unprocessedDocs = [];
 
                 InkTranscription.Instance.transcribeInk(newCollection, selected, false);
             });
@@ -378,7 +402,7 @@ export class InkTranscription extends React.Component {
         );
         docView.props.removeDocument?.(selected);
         // Gets a collection based on the selected nodes using a marquee view ref
-        const newCollection = MarqueeView.getCollection(selected, undefined, true, { left: 1, top: 1, width: 1, height: 1 });
+        const newCollection = MarqueeView.getCollection(selected, undefined, true, { top: 1, left: 1, width: 1, height: 1 });
         if (newCollection) {
             newCollection.width = NumCast(newCollection._width);
             newCollection.height = NumCast(newCollection._height);
-- 
cgit v1.2.3-70-g09d2

