aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-07-09 12:15:42 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-07-09 12:15:42 -0500
commit27b0f32460245539d77bcd435627a68364e0bc0d (patch)
treef30d6e4a83625f618e9ada7c01ddfc60c84662d7 /src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
parent15f70932a9e267393c774e9c4dd37a43224320f0 (diff)
fixed linking undo issues
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx96
1 files changed, 52 insertions, 44 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index a3d3a210d..ffa4be4b9 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1174,47 +1174,55 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P
@action
handleDragging = (e: Event, de: DragEvent) => {
- const nw = NumCast(this.Document._nativeWidth, this.props.NativeWidth());
- const nh = NumCast(this.Document._nativeHeight, this.props.NativeHeight());
- const hscale = nh ? this.props.PanelHeight() / nh : 1;
- const wscale = nw ? this.props.PanelWidth() / nw : 1;
+ const top = this.panX();
+ const left = this.panY();
+
+ const size = this.getTransform().transformDirection(this.props.PanelWidth(), this.props.PanelHeight());
+
+ const scale = this.getLocalTransform().inverse().Scale;
if (this._marqueeRef) {
+
if (this._marqueeRef.current) {
+ // console.log("top: " + this._marqueeRef.current.clientTop);
// console.log("left: " + this._marqueeRef.current.clientLeft);
// console.log("width: " + this._marqueeRef.current.clientWidth);
- // console.log("client x: " + de.clientX);
-
- // console.log("top: " + this._marqueeRef.current.clientTop);
// console.log("height: " + this._marqueeRef.current.clientHeight);
- // console.log("client y: " + de.clientY);
+
+ console.log("width: " + this._marqueeRef.current.getBoundingClientRect().width);
+ console.log("height: " + this._marqueeRef.current.getBoundingClientRect().width);
+ console.log("x: " + this._marqueeRef.current.getBoundingClientRect().x);
+ console.log("y: " + this._marqueeRef.current.getBoundingClientRect().y);
+
+ // console.log("mouse x: " + de.screenX);
+ // console.log("mouse y: " + de.screenY);
if (this._marqueeRef.current.clientWidth > 0) {
if (de.clientX - 315 - this._marqueeRef.current.clientLeft < 25) {
console.log("PAN left ");
- if (this.canPanX) {
- this.Document._panX = de.clientX - 20 - this._marqueeRef.current.clientLeft;
- setTimeout(action(() => {
- this.canPanX = true;
- this.panX();
- }), 2500);
- this.canPanX = false;
- }
+
+ // if (this.canPanX) {
+ // this.Document._panX = left - 5;
+ // setTimeout(action(() => {
+ // this.canPanX = true;
+ // this.panX();
+ // }), 250);
+ // this.canPanX = false;
+ // }
} else if (de.clientX - 315 - this._marqueeRef.current.clientLeft -
this._marqueeRef.current.clientWidth < 25) {
console.log("PAN right ");
- if (this.canPanX) {
- this.Document._panX = de.clientX - 315 - this._marqueeRef.current.clientLeft -
- this._marqueeRef.current.clientWidth;
-
- setTimeout(action(() => {
- this.panX();
- this.canPanX = true;
- }), 2500);
- this.canPanX = false;
- }
+
+ // if (this.canPanX) {
+ // this.Document._panX = left + 5;
+ // setTimeout(action(() => {
+ // this.panX();
+ // this.canPanX = true;
+ // }), 250);
+ // this.canPanX = false;
+ // }
}
}
@@ -1222,27 +1230,27 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P
if (this._marqueeRef.current.clientHeight > 0) {
if (de.clientY - 120 - this._marqueeRef.current.clientTop < 25) {
console.log("PAN top ");
- if (this.canPanY) {
- this.Document._panY = de.clientY - 20 - this._marqueeRef.current.clientTop;
- setTimeout(action(() => {
- this.canPanY = true;
- this.panY();
- }), 2500);
- this.canPanY = false;
- }
+
+ // if (this.canPanY) {
+ // this.Document._panY = top - 5;
+ // setTimeout(action(() => {
+ // this.canPanY = true;
+ // this.panY();
+ // }), 250);
+ // this.canPanY = false;
+ // }
} else if (de.clientY - 120 - this._marqueeRef.current.clientTop -
this._marqueeRef.current.clientHeight < 25) {
console.log("PAN bottom ");
- if (this.canPanY) {
- this.Document._panY = de.clientY - 120 - this._marqueeRef.current.clientTop -
- this._marqueeRef.current.clientHeight;
-
- setTimeout(action(() => {
- this.panY();
- this.canPanY = true;
- }), 2500);
- this.canPanY = false;
- }
+
+ // if (this.canPanY) {
+ // this.Document._panY = top + 5;
+ // setTimeout(action(() => {
+ // this.panY();
+ // this.canPanY = true;
+ // }), 250);
+ // this.canPanY = false;
+ // }
}