mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-19 04:55:57 +08:00
23 lines
672 B
JavaScript
Executable File
23 lines
672 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``
|
|
}
|
|
|
|
oppositePin() {
|
|
const nodeTemplate = /** @type {KnotNodeTemplate} */(this.element.nodeElement.template)
|
|
return this.element.isOutput() ? nodeTemplate.inputPin : nodeTemplate.outputPin
|
|
}
|
|
|
|
getLinkLocation() {
|
|
if (this.element.isInput()) {
|
|
return this.oppositePin().getLinkLocation()
|
|
}
|
|
return super.getLinkLocation()
|
|
}
|
|
}
|