Support drawing a node with connection that can be modified by user

This commit is contained in:
2024-02-20 00:18:53 +00:00
parent d73275f04c
commit 10ba3d642d
4 changed files with 55 additions and 30 deletions

View File

@@ -148,8 +148,8 @@ i32 run_main_loop(void) {
}
for (u64 i = 0; i < comp.count; ++i) {
comp.nodes[i].rec = ui_node(main_window, &(comp.ctx), comp.nodes[i].rec,
comp.nodes[i].colours);
comp.nodes[i].node = ui_node(main_window, &(comp.ctx), comp.nodes[i].node,
comp.nodes[i].colours);
}
for (u64 i = 0; i < MAX_WINDOWS; ++i) {
@@ -175,12 +175,16 @@ void add_node(compositor *comp, node_type type, node_data data, i32 x, i32 y,
}
comp->nodes[(comp->count)++] = (node){
.rec =
(rect){
.topleft.x = x,
.topleft.y = y,
.w = NODE_WIDTH,
.h = NODE_HEIGHT,
.node =
(ui_node_elem){
.rec =
(rect){
.topleft.x = x,
.topleft.y = y,
.w = NODE_WIDTH,
.h = NODE_HEIGHT,
},
.noodle = (line){0},
},
.colours = colours,
.type = type,