aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/MarqueeAnnotator.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/MarqueeAnnotator.tsx')
-rw-r--r--src/client/views/MarqueeAnnotator.tsx26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/client/views/MarqueeAnnotator.tsx b/src/client/views/MarqueeAnnotator.tsx
index 3f4200dce..d354dd2c0 100644
--- a/src/client/views/MarqueeAnnotator.tsx
+++ b/src/client/views/MarqueeAnnotator.tsx
@@ -97,7 +97,6 @@ export class MarqueeAnnotator extends ObservableReactComponent<MarqueeAnnotatorP
presentation_zoomText: true,
title: '>' + this.props.Document.title,
});
- const textRegionAnnoProto = textRegionAnno[DocData];
let minX = Number.MAX_VALUE;
let maxX = -Number.MAX_VALUE;
let minY = Number.MAX_VALUE;
@@ -118,15 +117,15 @@ export class MarqueeAnnotator extends ObservableReactComponent<MarqueeAnnotatorP
})
);
- textRegionAnnoProto.y = Math.max(minY, 0);
- textRegionAnnoProto.x = Math.max(minX, 0);
- textRegionAnnoProto.height = Math.max(maxY, 0) - Math.max(minY, 0);
- textRegionAnnoProto.width = Math.max(maxX, 0) - Math.max(minX, 0);
- textRegionAnnoProto.backgroundColor = color;
+ textRegionAnno.$y = Math.max(minY, 0);
+ textRegionAnno.$x = Math.max(minX, 0);
+ textRegionAnno.$height = Math.max(maxY, 0) - Math.max(minY, 0);
+ textRegionAnno.$width = Math.max(maxX, 0) - Math.max(minX, 0);
+ textRegionAnno.$backgroundColor = color;
// mainAnnoDocProto.text = this._selectionText;
- textRegionAnnoProto.text_inlineAnnotations = new List<string>(annoRects);
- textRegionAnnoProto.opacity = 0;
- textRegionAnnoProto.layout_unrendered = true;
+ textRegionAnno.$text_inlineAnnotations = new List<string>(annoRects);
+ textRegionAnno.$opacity = 0;
+ textRegionAnno.$layout_unrendered = true;
savedAnnoMap.clear();
return textRegionAnno;
};
@@ -195,13 +194,13 @@ export class MarqueeAnnotator extends ObservableReactComponent<MarqueeAnnotatorP
AnchorMenu.Instance.StartDrag = action((e: PointerEvent, ele: HTMLElement) => {
e.preventDefault();
e.stopPropagation();
- const sourceAnchorCreator = () => this.highlight(this.props.highlightDragSrcColor ?? 'rgba(173, 216, 230, 0.75)', true, undefined, true); // hyperlink color
-
const targetCreator = (annotationOn: Doc | undefined) => {
const target = DocUtils.GetNewTextDoc('Note linked to ' + this.props.Document.title, 0, 0, 100, 100, annotationOn, 'yellow');
+ target.layout_fitWidth = true;
DocumentView.SetSelectOnLoad(target);
return target;
};
+ const sourceAnchorCreator = () => this.highlight(this.props.highlightDragSrcColor ?? 'rgba(173, 216, 230, 0.75)', true, undefined, true); // hyperlink color
DragManager.StartAnchorAnnoDrag([ele], new DragManager.AnchorAnnoDragData(this.props.docView(), sourceAnchorCreator, targetCreator), e.pageX, e.pageY, {
dragComplete: dragEv => {
if (!dragEv.aborted && dragEv.annoDragData && dragEv.annoDragData.linkSourceDoc && dragEv.annoDragData.dropDocument && dragEv.linkDocument) {
@@ -226,9 +225,8 @@ export class MarqueeAnnotator extends ObservableReactComponent<MarqueeAnnotatorP
DragManager.StartAnchorAnnoDrag([ele], new DragManager.AnchorAnnoDragData(this.props.docView(), sourceAnchorCreator, targetCreator), e.pageX, e.pageY, {
dragComplete: dragEx => {
if (!dragEx.aborted && dragEx.linkDocument) {
- const linkDocData = dragEx.linkDocument[DocData];
- linkDocData.link_relationship = 'cropped image';
- linkDocData.title = 'crop: ' + this.props.Document.title;
+ dragEx.linkDocument.$link_relationship = 'cropped image';
+ dragEx.linkDocument.$title = 'crop: ' + this.props.Document.title;
}
},
});