diff options
| author | bobzel <zzzman@gmail.com> | 2022-06-05 10:56:03 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2022-06-05 10:56:03 -0400 |
| commit | 4bf54cdb7d2568f718446ddf6b7f17ba6a54ba91 (patch) | |
| tree | 3dd85bc2f4e8d4c3dda779ff486d887a4259a1c2 /src/client/views/nodes | |
| parent | d3e2c8d1be275ed04e0b5164960c3fc60334ce8f (diff) | |
fixed up drawing link lines to be less jittery and smoother looking. changed documentView to use a margin: auto when fitting width for something that can't grow to the size of the panel so that it will be centered in the panel and not docked at the top.
Diffstat (limited to 'src/client/views/nodes')
| -rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 1 | ||||
| -rw-r--r-- | src/client/views/nodes/LinkDocPreview.scss | 6 | ||||
| -rw-r--r-- | src/client/views/nodes/LinkDocPreview.tsx | 7 |
3 files changed, 11 insertions, 3 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 6e4d6a52e..e23bf24a9 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -1341,6 +1341,7 @@ export class DocumentView extends React.Component<DocumentViewProps> { transition: this.props.dataTransition, position: this.props.Document.isInkMask ? "absolute" : undefined, transform: isButton ? undefined : `translate(${this.centeringX}px, ${this.centeringY}px)`, + margin: this.fitWidth && this.panelHeight >= (this.ComponentView?.getScrollHeight?.() ?? 0) ? "auto" : undefined, width: isButton || isPresTreeElement ? "100%" : xshift() ?? `${100 * (this.props.PanelWidth() - this.Xshift * 2) / this.props.PanelWidth()}%`, height: isButton || this.props.forceAutoHeight ? undefined : yshift() ?? (this.fitWidth ? `${this.panelHeight}px` : `${100 * this.effectiveNativeHeight / this.effectiveNativeWidth * this.props.PanelWidth() / this.props.PanelHeight()}%`), diff --git a/src/client/views/nodes/LinkDocPreview.scss b/src/client/views/nodes/LinkDocPreview.scss index 06ae466f0..3febbcecb 100644 --- a/src/client/views/nodes/LinkDocPreview.scss +++ b/src/client/views/nodes/LinkDocPreview.scss @@ -1,4 +1,4 @@ - .linkDocPreview { +.linkDocPreview { position: absolute; pointer-events: all; background-color: lightblue; @@ -8,11 +8,14 @@ border-bottom: 8px solid white; border-right: 8px solid white; z-index: 2004; + .linkDocPreview-inner { background-color: white; width: 100%; height: 100%; pointer-events: none; + display: flex; + flex-direction: column; .linkDocPreview-info { height: 37px; @@ -21,6 +24,7 @@ .linkDocPreview-buttonBar { float: right; } + .linkDocPreview-title { padding-right: 4px; float: left; diff --git a/src/client/views/nodes/LinkDocPreview.tsx b/src/client/views/nodes/LinkDocPreview.tsx index b6a9cd49b..152288d8b 100644 --- a/src/client/views/nodes/LinkDocPreview.tsx +++ b/src/client/views/nodes/LinkDocPreview.tsx @@ -108,8 +108,11 @@ export class LinkDocPreview extends React.Component<LinkDocPreviewProps> { } nextHref = (e: React.PointerEvent) => { setupMoveUpEvents(this, e, returnFalse, emptyFunction, action(() => { - this._linkDoc = undefined; - this._hrefInd = (this._hrefInd + 1) % (this.props.hrefs?.length || 1); + const nextHrefInd = (this._hrefInd + 1) % (this.props.hrefs?.length || 1); + if (nextHrefInd !== this._hrefInd) { + this._linkDoc = undefined; + this._hrefInd = nextHrefInd; + } }), true); } |
