mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-23 23:34:43 +08:00
Various fixes
This commit is contained in:
@@ -6,7 +6,6 @@ import LinkTemplate from "../template/LinkTemplate"
|
||||
* @typedef {import("./GraphPin").default} GraphPin
|
||||
*/
|
||||
export default class GraphLink extends GraphElement {
|
||||
|
||||
/** @type {GraphPin} */
|
||||
#source
|
||||
/** @type {GraphPin} */
|
||||
@@ -23,7 +22,11 @@ export default class GraphLink extends GraphElement {
|
||||
super({}, new LinkTemplate())
|
||||
/** @type {import("../template/LinkTemplate").default} */
|
||||
this.template
|
||||
/** @type {SVGPathElement} */
|
||||
this.pathElement = null
|
||||
this.originatesFromInput = false
|
||||
this.sourceLocation = [0, 0]
|
||||
this.destinationLocation = [0, 0]
|
||||
this.setSourcePin(source)
|
||||
this.setDestinationPin(destination)
|
||||
}
|
||||
@@ -32,14 +35,16 @@ export default class GraphLink extends GraphElement {
|
||||
if (location == null) {
|
||||
location = this.#source.template.getLinkLocation(this.#source)
|
||||
}
|
||||
this.template.applySourceLocation(this, location)
|
||||
this.sourceLocation = location
|
||||
this.template.applySourceLocation(this)
|
||||
}
|
||||
|
||||
setDestinationLocation(location) {
|
||||
if (location == null) {
|
||||
location = this.#destination.template.getLinkLocation(this.#destination)
|
||||
}
|
||||
this.template.applyDestinationLocation(this, location)
|
||||
this.destinationLocation = location
|
||||
this.template.applyDestinationLocation(this)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ export default class GraphSelector extends GraphElement {
|
||||
* @param {number[]} initialPosition - Selection rectangle initial position (relative to the .ueb-grid element)
|
||||
*/
|
||||
startSelecting(initialPosition) {
|
||||
initialPosition = this.blueprint.compensateTranslation(initialPosition)
|
||||
this.template.applyStartSelecting(this, initialPosition)
|
||||
this.selectionModel = new FastSelectionModel(initialPosition, this.blueprint.getNodes(), this.blueprint.nodeBoundariesSupplier, this.blueprint.nodeSelectToggleFunction)
|
||||
}
|
||||
@@ -26,7 +25,6 @@ export default class GraphSelector extends GraphElement {
|
||||
* @param {number[]} finalPosition - Selection rectangle final position (relative to the .ueb-grid element)
|
||||
*/
|
||||
doSelecting(finalPosition) {
|
||||
finalPosition = this.blueprint.compensateTranslation(finalPosition)
|
||||
this.template.applyDoSelecting(this, finalPosition)
|
||||
this.selectionModel.selectTo(finalPosition)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user