Skip to content

Commit

Permalink
Always show node interface components for outputs (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
newcat committed Jul 24, 2023
1 parent 9305d59 commit 485a01e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/renderer-vue/playground/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div id="app">
<EditorComponent :view-model="baklavaView">
<template #node="nodeProps">
<CommentNode v-if="nodeProps.node.type === 'CommentNode'" v-bind="nodeProps" />
<CommentNodeRenderer v-if="nodeProps.node.type === 'CommentNode'" v-bind="nodeProps" />
<NodeComponent v-else v-bind="nodeProps" />
</template>
</EditorComponent>
Expand Down Expand Up @@ -37,6 +37,8 @@ import UpdateTestNode from "./UpdateTestNode";
import { stringType, numberType, booleanType } from "./interfaceTypes";
import CommentNodeRenderer from "./CommentNodeRenderer.vue";
const NodeComponent = Components.Node;
const token = Symbol("token");
Expand Down
4 changes: 2 additions & 2 deletions packages/renderer-vue/playground/TestNode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineNode } from "@baklavajs/core";
import { NodeInterface, defineNode } from "@baklavajs/core";
import { CheckboxInterface, NumberInterface, TextInputInterface, SelectInterface, SliderInterface } from "../src";

export default defineNode({
Expand All @@ -13,7 +13,7 @@ export default defineNode({
slider: () => new SliderInterface("Slider", 0.5, 0, 1).setPort(false),
},
outputs: {
output: () => new CheckboxInterface("Output", false),
output: () => new NodeInterface("Output", false),
},
calculate({ input }) {
return { output: input };
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer-vue/src/node/NodeInterface.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const classes = computed(() => ({
"--connected": isConnected.value,
}));
const showComponent = computed<boolean>(
() => props.intf.component && props.intf.connectionCount === 0 && (props.intf.isInput || !props.intf.port),
() => props.intf.component && (!props.intf.isInput || !props.intf.port || props.intf.connectionCount === 0),
);
const startHover = () => {
Expand Down

0 comments on commit 485a01e

Please sign in to comment.