diff options
| author | bobzel <zzzman@gmail.com> | 2022-05-12 12:17:12 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2022-05-12 12:17:12 -0400 |
| commit | c31bb0d5d8c4d42fb5cd97b1582de0cae1b16ca0 (patch) | |
| tree | 4ba3f42c13095418db18374a5a0537f7da910b88 /src/client/views/pdf/Annotation.tsx | |
| parent | 37f3c5f1d13bcb8a54d2b0a242df2ee499703dc5 (diff) | |
fixed perfromance (flickering, speed) issues with having pointerEvents prop invalidate documents - switched to using a function to avoid flickering on PDFs of annotations in particular.
Diffstat (limited to 'src/client/views/pdf/Annotation.tsx')
| -rw-r--r-- | src/client/views/pdf/Annotation.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/pdf/Annotation.tsx b/src/client/views/pdf/Annotation.tsx index b1d1d8293..218f37f3d 100644 --- a/src/client/views/pdf/Annotation.tsx +++ b/src/client/views/pdf/Annotation.tsx @@ -16,7 +16,7 @@ interface IAnnotationProps extends FieldViewProps { dataDoc: Doc; fieldKey: string; showInfo: (anno: Opt<Doc>) => void; - pointerEvents?: string; + pointerEvents?: () => Opt<string>; } @observer export @@ -28,7 +28,7 @@ export interface IRegionAnnotationProps extends IAnnotationProps { document: Doc; - pointerEvents?: string; + pointerEvents?: () => Opt<string>; } @observer class RegionAnnotation extends React.Component<IRegionAnnotationProps> { @@ -98,7 +98,7 @@ class RegionAnnotation extends React.Component<IRegionAnnotationProps> { width: NumCast(this.props.document._width), height: NumCast(this.props.document._height), opacity: this._brushed ? 0.5 : undefined, - pointerEvents: this.props.pointerEvents as any, + pointerEvents: this.props.pointerEvents?.() as any, backgroundColor: this._brushed ? "orange" : StrCast(this.props.document.backgroundColor), }} > </div>); |
