aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/trails
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-01-03 23:44:28 -0500
committerbobzel <zzzman@gmail.com>2024-01-03 23:44:28 -0500
commit2ea594a4c1ff221200e0795fb07d30b603177a67 (patch)
treeb1f8869320a460b88e7a832f6679b9fdb84e6e28 /src/client/views/nodes/trails
parent3f7b73ee8a3f75cd688ee7ddc7b54d90b00bee67 (diff)
cleaned up screenToLocalTransform in several places by making it additional methods. cleaned up styleProider api a bit to take DocumentViewInternalProps, not DocumentViewProps..
Diffstat (limited to 'src/client/views/nodes/trails')
-rw-r--r--src/client/views/nodes/trails/PresBox.tsx4
-rw-r--r--src/client/views/nodes/trails/PresElementBox.tsx4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index 0305689e7..6fa64a765 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -979,7 +979,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
enterMinimize = () => {
this.updateCurrentPresentation(this.Document);
clearTimeout(this._presTimer);
- const pt = this._props.ScreenToLocalTransform().inverse().transformPoint(0, 0);
+ const pt = this.ScreenToLocalBoxXf().inverse().transformPoint(0, 0);
this._props.removeDocument?.(this.layoutDoc);
return PresBox.OpenPresMinimized(this.Document, [pt[0] + (this._props.PanelWidth() - 250), pt[1] + 10]);
};
@@ -1076,7 +1076,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
childLayoutTemplate = () => Docs.Create.PresElementBoxDocument();
removeDocument = (doc: Doc) => Doc.RemoveDocFromList(this.Document, this.fieldKey, doc);
- getTransform = () => this._props.ScreenToLocalTransform().translate(-5, -65); // listBox padding-left and pres-box-cont minHeight
+ getTransform = () => this.ScreenToLocalBoxXf().translate(-5, -65); // listBox padding-left and pres-box-cont minHeight
panelHeight = () => this._props.PanelHeight() - 40;
/**
* For sorting the array so that the order is maintained when it is dropped.
diff --git a/src/client/views/nodes/trails/PresElementBox.tsx b/src/client/views/nodes/trails/PresElementBox.tsx
index ec5d090dd..4945d66c8 100644
--- a/src/client/views/nodes/trails/PresElementBox.tsx
+++ b/src/client/views/nodes/trails/PresElementBox.tsx
@@ -19,7 +19,7 @@ import { TreeView } from '../../collections/TreeView';
import { ViewBoxBaseComponent } from '../../DocComponent';
import { EditableView } from '../../EditableView';
import { Colors } from '../../global/globalEnums';
-import { DocumentView, DocumentViewProps } from '../../nodes/DocumentView';
+import { DocumentView, DocumentViewInternalProps, DocumentViewProps } from '../../nodes/DocumentView';
import { FieldView, FieldViewProps } from '../../nodes/FieldView';
import { StyleProp } from '../../StyleProvider';
import { PresBox } from './PresBox';
@@ -97,7 +97,7 @@ export class PresElementBox extends ViewBoxBaseComponent<FieldViewProps>() {
presExpandDocumentClick = () => (this.slideDoc.presentation_expandInlineButton = !this.slideDoc.presentation_expandInlineButton);
embedHeight = () => this.collapsedHeight + this.expandViewHeight;
embedWidth = () => this._props.PanelWidth() / 2;
- styleProvider = (doc: Doc | undefined, props: Opt<DocumentViewProps>, property: string): any => {
+ styleProvider = (doc: Doc | undefined, props: Opt<DocumentViewInternalProps | FieldViewProps>, property: string): any => {
return property === StyleProp.Opacity ? 1 : this._props.styleProvider?.(doc, props, property);
};
/**