aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/CollectionFreeFormDocumentView.tsx')
-rw-r--r--src/client/views/nodes/CollectionFreeFormDocumentView.tsx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
index 324a4b8d1..ad5aabc21 100644
--- a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
+++ b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
@@ -15,7 +15,8 @@ import { DocComponent } from '../DocComponent';
import { StyleProp } from '../StyleProvider';
import { CollectionFreeFormView } from '../collections/collectionFreeForm/CollectionFreeFormView';
import './CollectionFreeFormDocumentView.scss';
-import { DocumentView, DocumentViewProps, OpenWhere } from './DocumentView';
+import { DocumentView, DocumentViewInternalProps, DocumentViewProps, OpenWhere } from './DocumentView';
+import { FieldViewProps } from './FieldView';
export interface CollectionFreeFormDocumentViewWrapperProps extends DocumentViewProps {
x: number;
@@ -148,7 +149,7 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
return this._props.CollectionFreeFormView;
}
- styleProvider = (doc: Doc | undefined, props: Opt<DocumentViewProps>, property: string) => {
+ styleProvider = (doc: Doc | undefined, props: Opt<DocumentViewInternalProps | FieldViewProps>, property: string) => {
if (doc === this.layoutDoc) {
switch (property) {
case StyleProp.Opacity: return this._props.w_Opacity(); // only change the opacity for this specific document, not its children
@@ -229,7 +230,7 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
@action public float = () => {
const topDoc = this.Document;
const containerDocView = this._props.docViewPath().lastElement();
- const screenXf = containerDocView?.screenToNativeLocalTransform();
+ const screenXf = containerDocView?.screenToContentsTransform();
if (screenXf) {
SelectionManager.DeselectAll();
if (topDoc.z) {
@@ -251,7 +252,7 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
};
nudge = (x: number, y: number) => {
- const [locX, locY] = this._props.ScreenToLocalTransform().transformDirection(x, y);
+ const [locX, locY] = this.ScreenToLocalBoxXf().transformDirection(x, y);
this._props.Document.x = this._props.w_X() + locX;
this._props.Document.y = this._props.w_Y() + locY;
};