From 4bf54cdb7d2568f718446ddf6b7f17ba6a54ba91 Mon Sep 17 00:00:00 2001 From: bobzel Date: Sun, 5 Jun 2022 10:56:03 -0400 Subject: 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. --- src/client/views/nodes/LinkDocPreview.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/client/views/nodes/LinkDocPreview.tsx') 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 { } 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); } -- cgit v1.2.3-70-g09d2