aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/LinkDocPreview.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-06-05 10:56:03 -0400
committerbobzel <zzzman@gmail.com>2022-06-05 10:56:03 -0400
commit4bf54cdb7d2568f718446ddf6b7f17ba6a54ba91 (patch)
tree3dd85bc2f4e8d4c3dda779ff486d887a4259a1c2 /src/client/views/nodes/LinkDocPreview.tsx
parentd3e2c8d1be275ed04e0b5164960c3fc60334ce8f (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/LinkDocPreview.tsx')
-rw-r--r--src/client/views/nodes/LinkDocPreview.tsx7
1 files changed, 5 insertions, 2 deletions
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);
}