aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionStackingView.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-08-27 12:03:16 -0400
committerbob <bcz@cs.brown.edu>2019-08-27 12:03:16 -0400
commit8b210d872e3a9c540825be0e9fbb912514092def (patch)
treebb07da8cf29483a746f8dc84e9607ce9c702d9e9 /src/client/views/collections/CollectionStackingView.tsx
parent2b1035aa307a0cea6076030822cd5bb3c9793fb4 (diff)
fixes for doc decorations with resizing textboxes.
Diffstat (limited to 'src/client/views/collections/CollectionStackingView.tsx')
-rw-r--r--src/client/views/collections/CollectionStackingView.tsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index 6f22f2d2a..97b31bf2a 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -278,7 +278,8 @@ export class CollectionStackingView extends CollectionSubView(doc => doc) {
}
getDocTransform(doc: Doc, dref: HTMLDivElement) {
- let y = this._scroll;
+ if (!dref) return Transform.Identity();
+ let y = this._scroll; // required for document decorations to update when the text box container is scrolled
let { scale, translateX, translateY } = Utils.GetScreenTransform(dref);
let outerXf = Utils.GetScreenTransform(this._masonryGridRef!);
let offset = this.props.ScreenToLocalTransform().transformDirection(outerXf.translateX - translateX, outerXf.translateY - translateY);