Skip to content

Commit

Permalink
Moved translateX to ArrowMixin.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCoder committed Nov 21, 2024
1 parent 316db2e commit da936aa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ export default defineComponent({
anchorTarget: function (): Anchor {
return new Anchor(this.centerOf(this.target), this.targetOffset);
},

// Both 'left' and 'translateX' can be used to move the element horizontally.
// Change it to use translate according to https://stackoverflow.com/a/53892597/529187.
translateX: function () {
const destination = !this.rightToLeft
? this.anchorSource
: this.anchorTarget;
return this.anchorOrigin.calculateEdgeOffset(destination);
},
interactionWidth: function (): number {
return (
Math.abs(this.anchorSource.calculateEdgeOffset(this.anchorTarget)) -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ export default {
signature: function () {
return this.message?.SignatureText();
},
translateX: function () {
const destination = !this.rightToLeft
? this.anchorSource
: this.anchorTarget;
return this.anchorOrigin.calculateEdgeOffset(destination);
},
isCurrent: function () {
return this.message?.isCurrent(this.cursor);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,6 @@ export default {
anchorTarget: function () {
return new Anchor(this.centerOf(this.target), this.targetOffset);
},
// Both 'left' and 'translateX' can be used to move the element horizontally.
// Change it to use translate according to https://stackoverflow.com/a/53892597/529187.
translateX: function () {
const destination = !this.rightToLeft
? this.anchorSource
: this.anchorTarget;
return this.anchorOrigin.calculateEdgeOffset(destination);
},
signature: function () {
return this.asyncMessage?.content()?.getFormattedText();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ export default {
asyncMessage: function () {
return this.ret?.asyncMessage();
},
translateX: function () {
const destination = !this.rightToLeft
? this.anchorSource
: this.anchorTarget;
return this.anchorOrigin.calculateEdgeOffset(destination);
},
left: function () {
return this.rightToLeft
? this.distance(this.target, this.origin)
Expand Down

0 comments on commit da936aa

Please sign in to comment.