aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/MarqueeAnnotator.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-01-07 01:24:55 -0500
committerbobzel <zzzman@gmail.com>2025-01-07 01:24:55 -0500
commit93ee735e435de5949a0eec54c07537c4de2eedf4 (patch)
tree2a9aaea1a4deaea5500e45ab890536b593f74ca0 /src/client/views/MarqueeAnnotator.tsx
parent68af8fffb3111870dd84d4280fdd73b05832dfd2 (diff)
fixed pdfs/marqueeAnnotator so that you can add rectangle annotations.
Diffstat (limited to 'src/client/views/MarqueeAnnotator.tsx')
-rw-r--r--src/client/views/MarqueeAnnotator.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/MarqueeAnnotator.tsx b/src/client/views/MarqueeAnnotator.tsx
index fa1123a2d..02516264c 100644
--- a/src/client/views/MarqueeAnnotator.tsx
+++ b/src/client/views/MarqueeAnnotator.tsx
@@ -15,18 +15,19 @@ import './MarqueeAnnotator.scss';
import { DocumentView } from './nodes/DocumentView';
import { ObservableReactComponent } from './ObservableReactComponent';
import { AnchorMenu } from './pdf/AnchorMenu';
+import { Transform } from '../util/Transform';
export interface MarqueeAnnotatorProps {
Document: Doc;
down?: number[];
scrollTop: number;
- isNativeScaled?: boolean;
scaling?: () => number;
annotationLayerScaling?: () => number;
annotationLayerScrollTop: number;
containerOffset?: () => number[];
marqueeContainer: HTMLDivElement;
docView: () => DocumentView;
+ screenTransform: () => Transform;
savedAnnotations: () => ObservableMap<number, (HTMLDivElement & { marqueeing?: boolean })[]>;
selectionText: () => string;
annotationLayer: HTMLDivElement;
@@ -157,7 +158,7 @@ export class MarqueeAnnotator extends ObservableReactComponent<MarqueeAnnotatorP
// 4) reattach the vector to the center of the bounding box
getTransformedScreenPt = (down: number[]) => {
const { marqueeContainer } = this.props;
- const containerXf = this.props.isNativeScaled ? this.props.docView().screenToContentsTransform() : this.props.docView().screenToViewTransform();
+ const containerXf = this.props.screenTransform();
const boundingRect = marqueeContainer.getBoundingClientRect();
const center = { x: boundingRect.x + boundingRect.width / 2, y: boundingRect.y + boundingRect.height / 2 };
const downVec = Utils.rotPt(down[0] - center.x,