aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/MarqueeAnnotator.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-06-21 21:51:17 -0400
committerbobzel <zzzman@gmail.com>2022-06-21 21:51:17 -0400
commit669d20040a727cf0599126eccffb175643d4fa09 (patch)
treef14822bbda878b48301d8c7f4de89473bcfd6dc7 /src/client/views/MarqueeAnnotator.tsx
parente691d8e72ba632f0ef2d4122fe7233f9a48d4439 (diff)
parentb99e32960ff624237ca99c8d6ee756026a79003a (diff)
Merge branch 'master' into data-visualization-view-naafi
Diffstat (limited to 'src/client/views/MarqueeAnnotator.tsx')
-rw-r--r--src/client/views/MarqueeAnnotator.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/MarqueeAnnotator.tsx b/src/client/views/MarqueeAnnotator.tsx
index e15624e23..20b99788c 100644
--- a/src/client/views/MarqueeAnnotator.tsx
+++ b/src/client/views/MarqueeAnnotator.tsx
@@ -132,14 +132,14 @@ export class MarqueeAnnotator extends React.Component<MarqueeAnnotatorProps> {
if (savedAnnoMap.size === 0) return undefined;
const savedAnnos = Array.from(savedAnnoMap.values())[0];
if (savedAnnos.length && (savedAnnos[0] as any).marqueeing) {
- const scale = this.props.scaling?.() || 1;
+ const scale = (this.props.scaling?.() || 1);
const anno = savedAnnos[0];
const containerOffset = this.props.containerOffset?.() || [0, 0];
const marqueeAnno = Docs.Create.FreeformDocument([], { _isLinkButton: isLinkButton, backgroundColor: color, annotationOn: this.props.rootDoc, title: "Annotation on " + this.props.rootDoc.title });
- marqueeAnno.x = (parseInt(anno.style.left || "0") - containerOffset[0]) / scale;
- marqueeAnno.y = (parseInt(anno.style.top || "0") - containerOffset[1]) / scale + NumCast(this.props.scrollTop);
- marqueeAnno._height = parseInt(anno.style.height || "0") / scale;
- marqueeAnno._width = parseInt(anno.style.width || "0") / scale;
+ marqueeAnno.x = NumCast(this.props.docView.props.Document.panXMin) + (parseInt(anno.style.left || "0") - containerOffset[0]) / scale/ NumCast(this.props.docView.props.Document._viewScale,1);
+ marqueeAnno.y = NumCast(this.props.docView.props.Document.panYMin) + (parseInt(anno.style.top || "0") - containerOffset[1]) / scale/ NumCast(this.props.docView.props.Document._viewScale,1) + NumCast(this.props.scrollTop);
+ marqueeAnno._height = parseInt(anno.style.height || "0") / scale/ NumCast(this.props.docView.props.Document._viewScale,1);
+ marqueeAnno._width = parseInt(anno.style.width || "0") / scale/ NumCast(this.props.docView.props.Document._viewScale,1);
anno.remove();
savedAnnoMap.clear();
return marqueeAnno;