From 32a0d5be4ff7a49b554806c27dca5b63ea80277f Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 5 Feb 2021 17:59:41 -0500 Subject: fixed pushpin interactionson lightboxviews. fixed doc decorations on ligthboxviews --- src/client/views/LightboxView.tsx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/client/views/LightboxView.tsx b/src/client/views/LightboxView.tsx index a1047fafc..aa6e4d909 100644 --- a/src/client/views/LightboxView.tsx +++ b/src/client/views/LightboxView.tsx @@ -1,5 +1,5 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { action, observable } from 'mobx'; +import { action, observable, computed } from 'mobx'; import { observer } from 'mobx-react'; import "normalize.css"; import * as React from 'react'; @@ -22,10 +22,11 @@ export class LightboxView extends React.Component { public static LightboxHistory: (Opt)[] = []; public static LightboxFuture: (Opt)[] = []; public static LightboxDocView = React.createRef(); - public LightboxDocView = React.createRef(); - lightboxWidth = () => this.props.PanelWidth - Math.min(this.props.PanelWidth / 4, this.props.maxBorder[0]) * 2; - lightboxHeight = () => this.props.PanelHeight - Math.min(this.props.PanelHeight / 4, this.props.maxBorder[1]) * 2; - lightboxScreenToLocal = () => new Transform(-Math.min(this.props.PanelWidth / 4, this.props.maxBorder[0]), -Math.min(this.props.PanelHeight / 4, this.props.maxBorder[1]), 1); + @computed get leftBorder() { return Math.min(this.props.PanelWidth / 4, this.props.maxBorder[0]); } + @computed get topBorder() { return Math.min(this.props.PanelHeight / 4, this.props.maxBorder[1]); } + lightboxWidth = () => this.props.PanelWidth - this.leftBorder * 2; + lightboxHeight = () => this.props.PanelHeight - this.topBorder * 2; + lightboxScreenToLocal = () => new Transform(-this.leftBorder, -this.topBorder, 1); navBtn = (left: Opt, icon: string, display: () => string, click: (e: React.MouseEvent) => void) => { return
{ } render() { - console.log("ph = " + this.props.PanelHeight); if (LightboxView.LightboxHistory.lastElement() !== LightboxView.LightboxDoc) LightboxView.LightboxHistory.push(LightboxView.LightboxDoc); let downx = 0, downy = 0; return !LightboxView.LightboxDoc ? (null) : @@ -54,12 +54,12 @@ export class LightboxView extends React.Component { } })} >
- { docViewPath={emptyPath} removeDocument={undefined} styleProvider={DefaultStyleProvider} - layerProvider={undefined} + layerProvider={returnTrue} ScreenToLocalTransform={this.lightboxScreenToLocal} PanelWidth={this.lightboxWidth} PanelHeight={this.lightboxHeight} -- cgit v1.2.3-70-g09d2