From 4e1df78c6d94fabd949113801261150de8ed686c Mon Sep 17 00:00:00 2001 From: bobzel Date: Sat, 13 Feb 2021 21:14:05 -0500 Subject: fixed bug introduced where stacked documents couldn't be reordered. changed lightbox future a bit. --- src/client/views/collections/CollectionStackingView.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/client/views/collections/CollectionStackingView.tsx') diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx index 6425e1625..2d03c5279 100644 --- a/src/client/views/collections/CollectionStackingView.tsx +++ b/src/client/views/collections/CollectionStackingView.tsx @@ -44,7 +44,7 @@ export class CollectionStackingView extends CollectionSubView(); _pivotFieldDisposer?: IReactionDisposer; _autoHeightDisposer?: IReactionDisposer; - _docXfs: any[] = []; + _docXfs: { height: () => number, width: () => number, stackedDocTransform: () => Transform }[] = []; _columnStart: number = 0; @observable _heightMap = new Map(); @observable _cursor: CursorProperty = "grab"; @@ -204,6 +204,7 @@ export class CollectionStackingView extends CollectionSubView; const stackedDocTransform = () => this.getDocTransform(doc, dref); + this._docXfs.push({ stackedDocTransform, width, height }); return dref = r?.ContentDiv ? r.ContentDiv : undefined} Document={doc} DataDoc={dataDoc || (!Doc.AreProtosEqual(doc[DataSym], doc) && doc[DataSym])} @@ -295,8 +296,8 @@ export class CollectionStackingView extends CollectionSubView { - const pos = cd.dxf().inverse().transformPoint(-2 * this.gridGap, -2 * this.gridGap); - const pos1 = cd.dxf().inverse().transformPoint(cd.width(), cd.height()); + const pos = cd.stackedDocTransform().inverse().transformPoint(-2 * this.gridGap, -2 * this.gridGap); + const pos1 = cd.stackedDocTransform().inverse().transformPoint(cd.width(), cd.height()); if (where[0] > pos[0] && where[0] < pos1[0] && where[1] > pos[1] && (i === this._docXfs.length - 1 || where[1] < pos1[1])) { dropInd = i; const axis = this.Document._viewType === CollectionViewType.Masonry ? 0 : 1; @@ -327,8 +328,8 @@ export class CollectionStackingView extends CollectionSubView { - const pos = cd.dxf().inverse().transformPoint(-2 * this.gridGap, -2 * this.gridGap); - const pos1 = cd.dxf().inverse().transformPoint(cd.width(), cd.height()); + const pos = cd.stackedDocTransform().inverse().transformPoint(-2 * this.gridGap, -2 * this.gridGap); + const pos1 = cd.stackedDocTransform().inverse().transformPoint(cd.width(), cd.height()); if (where[0] > pos[0] && where[0] < pos1[0] && where[1] > pos[1] && where[1] < pos1[1]) { targInd = i; } -- cgit v1.2.3-70-g09d2