mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-02 05:04:43 +08:00
Rename some properties for uniformity
This commit is contained in:
@@ -9,7 +9,7 @@ export default class IFromToPositionedElement extends IElement {
|
||||
|
||||
static properties = {
|
||||
...super.properties,
|
||||
fromX: {
|
||||
originX: {
|
||||
type: Number,
|
||||
attribute: false,
|
||||
},
|
||||
@@ -17,11 +17,11 @@ export default class IFromToPositionedElement extends IElement {
|
||||
type: Number,
|
||||
attribute: false,
|
||||
},
|
||||
toX: {
|
||||
targetX: {
|
||||
type: Number,
|
||||
attribute: false,
|
||||
},
|
||||
toY: {
|
||||
targetY: {
|
||||
type: Number,
|
||||
attribute: false,
|
||||
},
|
||||
@@ -29,18 +29,18 @@ export default class IFromToPositionedElement extends IElement {
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
this.fromX = 0
|
||||
this.fromY = 0
|
||||
this.toX = 0
|
||||
this.toY = 0
|
||||
this.originX = 0
|
||||
this.originY = 0
|
||||
this.targetX = 0
|
||||
this.targetY = 0
|
||||
}
|
||||
|
||||
/** @param {Coordinates} param0 */
|
||||
setBothLocations([x, y]) {
|
||||
this.fromX = x
|
||||
this.fromY = y
|
||||
this.toX = x
|
||||
this.toY = y
|
||||
this.originX = x
|
||||
this.originY = y
|
||||
this.targetX = x
|
||||
this.targetY = y
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,8 +48,8 @@ export default class IFromToPositionedElement extends IElement {
|
||||
* @param {Number} y
|
||||
*/
|
||||
addOriginLocation(x, y) {
|
||||
this.fromX += x
|
||||
this.fromY += y
|
||||
this.originX += x
|
||||
this.originY += y
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,7 +57,7 @@ export default class IFromToPositionedElement extends IElement {
|
||||
* @param {Number} y
|
||||
*/
|
||||
addTargetLocation(x, y) {
|
||||
this.toX += x
|
||||
this.toY += y
|
||||
this.targetX += x
|
||||
this.targetY += y
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,15 +129,15 @@ export default class LinkElement extends IFromToPositionedElement {
|
||||
if (origin) {
|
||||
this.origin = origin
|
||||
if (!target) {
|
||||
this.toX = this.fromX
|
||||
this.toY = this.fromY
|
||||
this.targetX = this.originX
|
||||
this.targetY = this.originY
|
||||
}
|
||||
}
|
||||
if (target) {
|
||||
this.target = target
|
||||
if (!origin) {
|
||||
this.fromX = this.toX
|
||||
this.fromY = this.toY
|
||||
this.originX = this.targetX
|
||||
this.originY = this.targetY
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -224,8 +224,8 @@ export default class LinkElement extends IFromToPositionedElement {
|
||||
location = this.origin.template.getLinkLocation()
|
||||
}
|
||||
const [x, y] = location
|
||||
this.fromX = x
|
||||
this.fromY = y
|
||||
this.originX = x
|
||||
this.originY = y
|
||||
}
|
||||
|
||||
/** @param {Coordinates} location */
|
||||
@@ -239,8 +239,8 @@ export default class LinkElement extends IFromToPositionedElement {
|
||||
}
|
||||
location = this.target.template.getLinkLocation()
|
||||
}
|
||||
this.toX = location[0]
|
||||
this.toY = location[1]
|
||||
this.targetX = location[0]
|
||||
this.targetY = location[1]
|
||||
}
|
||||
|
||||
getInputPin(getSomething = false) {
|
||||
|
||||
@@ -37,16 +37,16 @@ export default class SelectorElement extends IFromToPositionedElement {
|
||||
/** @param {Coordinates} finalPosition */
|
||||
selectTo(finalPosition) {
|
||||
this.selectionModel.selectTo(finalPosition)
|
||||
this.toX = finalPosition[0]
|
||||
this.toY = finalPosition[1]
|
||||
this.targetX = finalPosition[0]
|
||||
this.targetY = finalPosition[1]
|
||||
}
|
||||
|
||||
endSelect() {
|
||||
this.blueprint.selecting = false
|
||||
this.selectionModel = null
|
||||
this.fromX = 0
|
||||
this.fromY = 0
|
||||
this.toX = 0
|
||||
this.toY = 0
|
||||
this.originX = 0
|
||||
this.originY = 0
|
||||
this.targetX = 0
|
||||
this.targetY = 0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user