diff options
author | bobzel <zzzman@gmail.com> | 2021-02-12 18:01:34 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-02-12 18:01:34 -0500 |
commit | d8bb0894ce986329c55837e32591bcf5b9f8ed4b (patch) | |
tree | b592a85140971f05ad5c75679c30ebff6dc7671c /src | |
parent | 926665e2367ff6a201a48618df6f7985ddbcb4b0 (diff) |
set max zoom in for lightbox/linkfollowing. fixed rendering artifact where PDFs in layer behind lightbox get drawn on top of lightbox when zoomed in far enough
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/GestureOverlay.scss | 1 | ||||
-rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/client/views/GestureOverlay.scss b/src/client/views/GestureOverlay.scss index c9d78890e..16a4c74d1 100644 --- a/src/client/views/GestureOverlay.scss +++ b/src/client/views/GestureOverlay.scss @@ -5,6 +5,7 @@ top: 0; left: 0; touch-action: none; + z-index: -1; .pointerBubbles { width: 100%; diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 7aecf12b0..eb99702a1 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -967,7 +967,8 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P const bounds = { left: pt[0], right: pt2[0], top: pt[1], bot: pt2[1] }; if (scale) { - this.Document[this.scaleFieldKey] = scale * Math.min(this.props.PanelWidth() / Math.abs(pt2[0] - pt[0]), this.props.PanelHeight() / Math.abs(pt2[1] - pt[1])); + const maxZoom = 2; // sets the limit for how far we will zoom. this is useful for preventing small text boxes from filling the screen. So probably needs to be more sophisticated to consider more about the target and context + this.Document[this.scaleFieldKey] = Math.min(maxZoom, scale * Math.min(this.props.PanelWidth() / Math.abs(pt2[0] - pt[0]), this.props.PanelHeight() / Math.abs(pt2[1] - pt[1]))); return { px: (bounds.left + bounds.right) / 2, py: (bounds.top + bounds.bot) / 2 }; } else { const cx = NumCast(this.layoutDoc._panX); |