aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/button/FontIconBox.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/button/FontIconBox.tsx')
-rw-r--r--src/client/views/nodes/button/FontIconBox.tsx56
1 files changed, 5 insertions, 51 deletions
diff --git a/src/client/views/nodes/button/FontIconBox.tsx b/src/client/views/nodes/button/FontIconBox.tsx
index fc358f106..85130e69e 100644
--- a/src/client/views/nodes/button/FontIconBox.tsx
+++ b/src/client/views/nodes/button/FontIconBox.tsx
@@ -757,13 +757,17 @@ export function createInkGroup(inksToGroup?: Doc[]) {
ffView.props.removeDocument?.(selected);
// TODO: nda - this is the code to actually get a new grouped collection
const newCollection = marqViewRef?.getCollection(selected, undefined, [], true);
+ if (newCollection) {
+ newCollection.height = newCollection[HeightSym]();
+ newCollection.width = newCollection[WidthSym]();
+ }
// nda - bug: when deleting a stroke before leaving writing mode, delete the stroke from unprocessed ink docs
newCollection && ffView.props.addDocument?.(newCollection);
// TODO: nda - will probably need to go through and only remove the unprocessed selected docs
ffView.unprocessedDocs = [];
- InkTranscription.Instance.transcribeInk(newCollection, selected, false);
+ InkTranscription.Instance.transcribeInk(newCollection, selected, false, ffView);
});
}
CollectionFreeFormView.collectionsWithUnprocessedInk.clear();
@@ -778,56 +782,6 @@ export function createInkGroup(inksToGroup?: Doc[]) {
ScriptingGlobals.add(function setActiveInkTool(tool: string, checkResult?: boolean) {
createInkGroup();
- // if (CurrentUserUtils.SelectedTool === InkTool.Write) {
- // CollectionFreeFormView.collectionsWithUnprocessedInk.forEach(ffView => {
- // const selected = ffView.unprocessedDocs;
- // // loop through selected an get the bound
- // const bounds: { x: number, y: number, width?: number, height?: number }[] = []
-
- // selected.map(action(d => {
- // const x = NumCast(d.x);
- // const y = NumCast(d.y);
- // const width = d[WidthSym]();
- // const height = d[HeightSym]();
- // bounds.push({x, y, width, height});
- // }))
-
- // const aggregBounds = aggregateBounds(bounds, 0, 0);
- // const marqViewRef = ffView._marqueeViewRef.current;
-
- // // set the vals for bounds in marqueeView
- // if (marqViewRef) {
- // marqViewRef._downX = aggregBounds.x;
- // marqViewRef._downY = aggregBounds.y;
- // marqViewRef._lastX = aggregBounds.r;
- // marqViewRef._lastY = aggregBounds.b;
- // }
-
- // selected.map(action(d => {
- // const dx = NumCast(d.x);
- // const dy = NumCast(d.y);
- // delete d.x;
- // delete d.y;
- // delete d.activeFrame;
- // delete d._timecodeToShow; // bcz: this should be automatic somehow.. along with any other properties that were logically associated with the original collection
- // delete d._timecodeToHide; // bcz: this should be automatic somehow.. along with any other properties that were logically associated with the original collection
- // // calculate pos based on bounds
- // if (marqViewRef?.Bounds) {
- // d.x = dx - marqViewRef.Bounds.left - marqViewRef.Bounds.width / 2;
- // d.y = dy - marqViewRef.Bounds.top - marqViewRef.Bounds.height / 2;
- // }
- // return d;
- // }));
- // ffView.props.removeDocument?.(selected);
- // // TODO: nda - this is the code to actually get a new grouped collection
- // const newCollection = marqViewRef?.getCollection(selected, undefined, [], true);
-
- // // nda - bug: when deleting a stroke before leaving writing mode, delete the stroke from unprocessed ink docs
- // newCollection && ffView.props.addDocument?.(newCollection);
- // ffView.unprocessedDocs = [];
- // });
- // }
- // CollectionFreeFormView.collectionsWithUnprocessedInk.clear();
if (checkResult) {
return ((Doc.UserDoc().activeInkTool === tool && !GestureOverlay.Instance?.InkShape) || GestureOverlay.Instance?.InkShape === tool) ?