compositor-test/src/nodes.c

14 lines
449 B
C

#include "nodes.h"
#include "aliases/aliases.h"
#include <stdbool.h>
bool aabb(const node_t *node, i32 x, i32 y) {
return x > node->rect.topleft.x && x <= node->rect.topleft.x + node->rect.w &&
y > node->rect.topleft.y && y <= node->rect.topleft.y + node->rect.h;
}
void draw_node(const window_t *wnd, const node_t *node) {
fill_rect(wnd, &(node->rect), IO_NODE_FILL_COLOUR);
draw_rect(wnd, &(node->rect), IO_NODE_BORDER_COLOUR);
}