diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-25 18:27:07 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-25 18:27:07 -0500 |
commit | 2baf965c7db4a3640cd120e050c61aa7de67448b (patch) | |
tree | 4ea6d87d6157b3d25eba24aa8805a10219c44a2f /node.c | |
parent | 3ff107c7ca438749a8425feef9eefb67c7a8abfc (diff) |
node resizing working
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -283,7 +283,7 @@ static void node_frame(Ted *ted, Node *node, Rect r) { 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 - float min_split = 10.0f / (node->split_vertical ? r.size.y : r.size.x); + float min_split = 50.0f / (node->split_vertical ? r.size.y : r.size.x); node->split_pos = clampf(normf(mouse_coord, rect_coord1, rect_coord2), min_split, 1-min_split); } } @@ -316,7 +316,7 @@ static void node_frame(Ted *ted, Node *node, Rect r) { } static void node_split(Ted *ted, Node *node, bool vertical) { - if (node_depth(ted, (u16)(node - ted->nodes)) >= 5) return; // prevent splitting too deep + if (node_depth(ted, (u16)(node - ted->nodes)) >= 4) return; // prevent splitting too deep if (arr_len(node->tabs) > 1) { // need at least 2 tabs to split i32 left_idx = ted_new_node(ted); |