mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-15 09:44:49 +08:00
24 lines
803 B
JavaScript
Executable File
24 lines
803 B
JavaScript
Executable File
import { html } from "lit"
|
|
import MinimalPinTemplate from "./MinimalPinTemplate.js"
|
|
|
|
/** @extends MinimalPinTemplate<KnotEntity> */
|
|
export default class KnotPinTemplate extends MinimalPinTemplate {
|
|
|
|
render() {
|
|
return this.element.isOutput() ? super.render() : html``
|
|
}
|
|
|
|
getoppositePin() {
|
|
const nodeTemplate = /** @type {KnotNodeTemplate} */(this.element.nodeElement.template)
|
|
return this.element.isOutput() ? nodeTemplate.inputPin : nodeTemplate.outputPin
|
|
}
|
|
|
|
/** Location on the grid of a link connecting to this pin */
|
|
getLinkLocation(oppositeDirection = false) {
|
|
if (this.element.isInput()) {
|
|
return this.getoppositePin().getLinkLocation(!oppositeDirection)
|
|
}
|
|
return super.getLinkLocation(oppositeDirection)
|
|
}
|
|
}
|