aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authorgeireann <60007097+geireann@users.noreply.github.com>2022-06-05 17:11:22 +0100
committergeireann <60007097+geireann@users.noreply.github.com>2022-06-05 17:11:22 +0100
commitd939e83f1279cb010b3573f0ac02ba4dc7c3cb37 (patch)
tree3b4fde1f3cda8da9d12b79284cfbb84f2f280a04 /src/client/views/collections
parentacf19e54a43d5b05c58ef3c80d27086dd64f8e8e (diff)
updates and attempts at debugging
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/TabDocView.tsx15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx
index 0cd3fb5a7..004032282 100644
--- a/src/client/views/collections/TabDocView.tsx
+++ b/src/client/views/collections/TabDocView.tsx
@@ -220,6 +220,14 @@ export class TabDocView extends React.Component<TabDocViewProps> {
const size: number = PresBox.Instance?._selectedArray.size;
const presSelected: Doc | undefined = presArray && size ? presArray[size - 1] : undefined;
const duration = NumCast(doc[`${Doc.LayoutFieldKey(pinDoc)}-duration`], null);
+ // If pinWithView option set then update scale and x / y props of slide
+ if (pinProps?.pinWithView) {
+ const viewProps = pinProps.pinWithView;
+ pinDoc.presPinView = true;
+ pinDoc.presPinViewX = viewProps.bounds.left + viewProps.bounds.width / 2;
+ pinDoc.presPinViewY = viewProps.bounds.top + viewProps.bounds.height / 2;
+ pinDoc.presPinViewScale = viewProps.scale;
+ }
Doc.AddDocToList(curPres, "data", pinDoc, presSelected);
if (!pinProps?.audioRange && duration !== undefined) {
pinDoc.mediaStart = "manual";
@@ -241,13 +249,6 @@ export class TabDocView extends React.Component<TabDocViewProps> {
const dview = CollectionDockingView.Instance.props.Document;
const fieldKey = CollectionDockingView.Instance.props.fieldKey;
const tabdocs = await DocListCastAsync(dview[fieldKey]);
- if (pinProps?.pinWithView) {
- const viewProps = pinProps.pinWithView;
- pinDoc.presPinView = true;
- pinDoc.presPinViewX = viewProps.bounds.left + viewProps.bounds.width / 2;
- pinDoc.presPinViewY = viewProps.bounds.top + viewProps.bounds.height / 2;
- pinDoc.presPinViewScale = viewProps.scale;
- }
runInAction(() => {
if (!pinProps?.hidePresBox && !tabdocs?.includes(curPres)) {
tabdocs?.push(curPres); // bcz: Argh! this is annoying. if multiple documents are pinned, this will get called multiple times before the presentation view is drawn. Thus it won't be in the tabdocs list and it will get created multple times. so need to explicilty add the presbox to the list of open tabs