aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/global/globalScripts.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/global/globalScripts.ts')
-rw-r--r--src/client/views/global/globalScripts.ts25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/client/views/global/globalScripts.ts b/src/client/views/global/globalScripts.ts
index 894afebfd..b529991cb 100644
--- a/src/client/views/global/globalScripts.ts
+++ b/src/client/views/global/globalScripts.ts
@@ -1,25 +1,24 @@
import { Colors } from 'browndash-components';
-import { runInAction, action } from 'mobx';
-import { aggregateBounds } from '../../../Utils';
+import { action, runInAction } from 'mobx';
import { Doc } from '../../../fields/Doc';
-import { Width, Height } from '../../../fields/DocSymbols';
import { InkTool } from '../../../fields/InkField';
-import { Cast, StrCast, NumCast, BoolCast } from '../../../fields/Types';
+import { BoolCast, Cast, NumCast, StrCast } from '../../../fields/Types';
import { WebField } from '../../../fields/URLField';
import { GestureUtils } from '../../../pen-gestures/GestureUtils';
+import { aggregateBounds } from '../../../Utils';
+import { DocumentType } from '../../documents/DocumentTypes';
import { LinkManager } from '../../util/LinkManager';
import { ScriptingGlobals } from '../../util/ScriptingGlobals';
import { SelectionManager } from '../../util/SelectionManager';
import { undoable, UndoManager } from '../../util/UndoManager';
+import { CollectionFreeFormView } from '../collections/collectionFreeForm';
import { GestureOverlay } from '../GestureOverlay';
+import { ActiveFillColor, ActiveInkColor, ActiveInkWidth, ActiveIsInkMask, InkingStroke, SetActiveFillColor, SetActiveInkColor, SetActiveInkWidth, SetActiveIsInkMask } from '../InkingStroke';
import { InkTranscription } from '../InkTranscription';
-import { ActiveFillColor, SetActiveFillColor, ActiveIsInkMask, SetActiveIsInkMask, ActiveInkWidth, SetActiveInkWidth, ActiveInkColor, SetActiveInkColor, InkingStroke } from '../InkingStroke';
-import { CollectionFreeFormView } from '../collections/collectionFreeForm';
import { CollectionFreeFormDocumentView } from '../nodes/CollectionFreeFormDocumentView';
-import { WebBox } from '../nodes/WebBox';
-import { RichTextMenu } from '../nodes/formattedText/RichTextMenu';
-import { DocumentType } from '../../documents/DocumentTypes';
import { DocumentView } from '../nodes/DocumentView';
+import { RichTextMenu } from '../nodes/formattedText/RichTextMenu';
+import { WebBox } from '../nodes/WebBox';
ScriptingGlobals.add(function IsNoneSelected() {
return SelectionManager.Views().length <= 0;
@@ -239,8 +238,8 @@ export function createInkGroup(inksToGroup?: Doc[], isSubGroup?: boolean) {
action(d => {
const x = NumCast(d.x);
const y = NumCast(d.y);
- const width = d[Width]();
- const height = d[Height]();
+ const width = NumCast(d._width);
+ const height = NumCast(d._height);
bounds.push({ x, y, width, height });
})
);
@@ -277,8 +276,8 @@ export function createInkGroup(inksToGroup?: Doc[], isSubGroup?: boolean) {
// 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[Height]();
- newCollection.width = newCollection[Width]();
+ newCollection.height = NumCast(newCollection._height);
+ newCollection.width = NumCast(newCollection._width);
}
// nda - bug: when deleting a stroke before leaving writing mode, delete the stroke from unprocessed ink docs