diff options
author | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-06-03 13:33:37 -0400 |
---|---|---|
committer | Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> | 2024-06-03 13:33:37 -0400 |
commit | 9e77f980e7704999ef0a1c1845d660bccb13ff8a (patch) | |
tree | 14ca0da5915e4382a7bcb15f7d0b241941c8291f /src/fields/Doc.ts | |
parent | 1be63695875c9242fba43d580465e8765cf3991d (diff) | |
parent | 202e994515392892676f8f080852db1e32b8dbd3 (diff) |
Merge branch 'master' into nathan-starter
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index fe044c035..1b3d963e8 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -185,6 +185,7 @@ export function ActiveArrowScale(): number { return NumCast(ActiveInkPen()?.acti export function ActiveDash(): string { return StrCast(ActiveInkPen()?.activeDash, '0'); } // prettier-ignore export function ActiveInkWidth(): number { return Number(ActiveInkPen()?.activeInkWidth); } // prettier-ignore export function ActiveInkBezierApprox(): string { return StrCast(ActiveInkPen()?.activeInkBezier); } // prettier-ignore +export function ActiveEraserWidth(): number { return Number(ActiveInkPen()?.eraserWidth); } // prettier-ignore export function SetActiveInkWidth(width: string): void { !isNaN(parseInt(width)) && ActiveInkPen() && (ActiveInkPen().activeInkWidth = width); @@ -216,6 +217,9 @@ export function SetActiveArrowScale(value: number) { export function SetActiveDash(dash: string): void { !isNaN(parseInt(dash)) && ActiveInkPen() && (ActiveInkPen().activeDash = dash); } +export function SetEraserWidth(width: number): void { + ActiveInkPen() && (ActiveInkPen().eraserWidth = width); +} @scriptingGlobal @Deserializable('Doc', updateCachedAcls, ['id']) @@ -1297,10 +1301,12 @@ export namespace Doc { document.removeEventListener('pointerdown', linkFollowUnhighlight); document.addEventListener('pointerdown', linkFollowUnhighlight); if (UnhighlightTimer) clearTimeout(UnhighlightTimer); + const presTransition = Number(presentationEffect?.presentation_transition); + const duration = isNaN(presTransition) ? 5000 : presTransition; UnhighlightTimer = window.setTimeout(() => { linkFollowUnhighlight(); UnhighlightTimer = 0; - }, 5000); + }, duration); } export const highlightedDocs = new ObservableSet<Doc>(); |