summaryrefslogtreecommitdiff
path: root/node.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-09-07 15:18:45 -0400
committerpommicket <pommicket@gmail.com>2023-09-07 22:49:53 -0400
commit5cad1bee9b72610d9d97b5f97e7f1a245a2d2ba5 (patch)
tree5ee6f155f6900be4eeec07ad33417d2d9992a80f /node.c
parent815d652b570f53c989f62d0c7db847d7d6dfd940 (diff)
more diagnostics
Diffstat (limited to 'node.c')
-rw-r--r--node.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/node.c b/node.c
index ee99883..aaa730f 100644
--- a/node.c
+++ b/node.c
@@ -383,7 +383,8 @@ void node_frame(Ted *ted, Node *node, Rect r) {
if (node == ted->dragging_tab_node && i == ted->dragging_tab_idx) {
// make tab follow mouse
- tab_rect.pos = vec2_add(tab_rect.pos, vec2_sub(ted->mouse_pos, ted->dragging_tab_origin));
+ tab_rect.pos = vec2_add(tab_rect.pos,
+ vec2_sub(ted_mouse_pos(ted), ted->dragging_tab_origin));
}
// tab border
@@ -447,7 +448,8 @@ void node_frame(Ted *ted, Node *node, Rect r) {
ted->resizing_split = NULL;
} else {
// resize the split
- float mouse_coord = node->split_vertical ? ted->mouse_pos.y : ted->mouse_pos.x;
+ const vec2 mouse_pos = ted_mouse_pos(ted);
+ float mouse_coord = node->split_vertical ? mouse_pos.y : mouse_pos.x;
float rect_coord1 = (node->split_vertical ? rect_y1 : rect_x1)(r);
float rect_coord2 = (node->split_vertical ? rect_y2 : rect_x2)(r);
// make sure the split doesn't make one of the sides too small
@@ -469,7 +471,7 @@ void node_frame(Ted *ted, Node *node, Rect r) {
r2.size.x = r.size.x - split_pos - padding;
r_between = rect_xywh(r.pos.x + split_pos - padding, r.pos.y, 2 * padding, r.size.y);
}
- if (rect_contains_point(r_between, ted->mouse_pos)) {
+ if (ted_mouse_in_rect(ted, r_between)) {
ted->cursor = resize_cursor;
}
if (ted_clicked_in_rect(ted, r_between))