aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/Annotation.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/pdf/Annotation.tsx')
-rw-r--r--src/client/views/pdf/Annotation.tsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/views/pdf/Annotation.tsx b/src/client/views/pdf/Annotation.tsx
index 1891cfd4c..e8a5235c9 100644
--- a/src/client/views/pdf/Annotation.tsx
+++ b/src/client/views/pdf/Annotation.tsx
@@ -50,7 +50,7 @@ interface IAnnotationProps extends FieldViewProps {
}
@observer
export class Annotation extends ObservableReactComponent<IAnnotationProps> {
- constructor(props: any) {
+ constructor(props: IAnnotationProps) {
super(props);
makeObservable(this);
}
@@ -58,7 +58,7 @@ export class Annotation extends ObservableReactComponent<IAnnotationProps> {
@computed get linkHighlighted() {
const found = LinkManager.Instance.getAllDirectLinks(this._props.annoDoc).find(link => {
const a1 = Doc.getOppositeAnchor(link, this._props.annoDoc);
- return a1 && Doc.GetBrushStatus(DocCast(a1.annotationOn, a1));
+ return a1 && Doc.GetBrushStatus(DocCast(a1.annotationOn, a1)!);
});
return found;
}
@@ -112,6 +112,7 @@ export class Annotation extends ObservableReactComponent<IAnnotationProps> {
outline = () => (this.linkHighlighted ? 'solid 1px lightBlue' : undefined);
background = () => (this._props.annoDoc[Highlight] ? 'orange' : StrCast(this._props.annoDoc.backgroundColor));
render() {
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
const forceRenderHack = [this.background(), this.outline(), this.opacity()]; // forces a re-render when these change -- because RegionAnnotation doesn't do this internally..
return (
<div style={{ display: this._props.annoDoc.textCopied && !Doc.GetBrushHighlightStatus(this._props.annoDoc) ? 'none' : undefined }}>
@@ -121,7 +122,7 @@ export class Annotation extends ObservableReactComponent<IAnnotationProps> {
.map(([x, y, width, height]) => (
<div
key={'' + x + y + width + height}
- style={{ pointerEvents: this._props.pointerEvents?.() as any }}
+ style={{ pointerEvents: this._props.pointerEvents?.() as Property.PointerEvents }}
onPointerDown={this.onPointerDown}
onContextMenu={this.onContextMenu}
onPointerEnter={() => {