mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-17 17:42:22 -07:00
force hover eval in window on X axis only; store expr strings rather than expr trees in auto hook map
This commit is contained in:
@@ -461,7 +461,7 @@ e_auto_hook_map_insert_new_(Arena *arena, E_AutoHookMap *map, E_AutoHookParams *
|
||||
E_AutoHookNode *node = push_array(arena, E_AutoHookNode, 1);
|
||||
node->type_string = str8_skip_chop_whitespace(e_type_string_from_key(arena, type_key));
|
||||
node->type_pattern_parts = pattern_parts;
|
||||
node->expr = e_parse_from_string(params->tag_expr_string).expr;
|
||||
node->expr_string = push_str8_copy(arena, params->tag_expr_string);
|
||||
if(!e_type_key_match(e_type_key_zero(), type_key))
|
||||
{
|
||||
U64 hash = e_hash_from_string(5381, node->type_string);
|
||||
@@ -1054,7 +1054,8 @@ e_auto_hook_exprs_from_type_key(Arena *arena, E_TypeKey type_key)
|
||||
{
|
||||
if(str8_match(n->type_string, type_string, 0))
|
||||
{
|
||||
e_expr_list_push(arena, &exprs, n->expr);
|
||||
E_Expr *expr = e_parse_from_string(n->expr_string).expr;
|
||||
e_expr_list_push(arena, &exprs, expr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1089,7 +1090,8 @@ e_auto_hook_exprs_from_type_key(Arena *arena, E_TypeKey type_key)
|
||||
}
|
||||
if(fits_this_type_string)
|
||||
{
|
||||
e_expr_list_push(arena, &exprs, auto_hook_node->expr);
|
||||
E_Expr *expr = e_parse_from_string(auto_hook_node->expr_string).expr;
|
||||
e_expr_list_push(arena, &exprs, expr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -669,7 +669,7 @@ struct E_AutoHookNode
|
||||
E_AutoHookNode *pattern_order_next;
|
||||
String8 type_string;
|
||||
String8List type_pattern_parts;
|
||||
E_Expr *expr;
|
||||
String8 expr_string;
|
||||
};
|
||||
|
||||
typedef struct E_AutoHookSlot E_AutoHookSlot;
|
||||
@@ -884,6 +884,12 @@ struct E_UsedExprMap
|
||||
|
||||
//- rjf: type key -> auto hook expression list cache
|
||||
|
||||
typedef struct E_TypeAutoHookMatch E_TypeAutoHookMatch;
|
||||
struct E_TypeAutoHookMatch
|
||||
{
|
||||
String8 expr;
|
||||
};
|
||||
|
||||
typedef struct E_TypeAutoHookCacheNode E_TypeAutoHookCacheNode;
|
||||
struct E_TypeAutoHookCacheNode
|
||||
{
|
||||
|
||||
@@ -6903,7 +6903,8 @@ rd_window_frame(void)
|
||||
Rng2F32 rect;
|
||||
B32 is_focused;
|
||||
B32 is_anchored;
|
||||
B32 force_inside_window;
|
||||
B32 force_inside_window_x;
|
||||
B32 force_inside_window_y;
|
||||
B32 only_secondary_navigation;
|
||||
B32 reset_open;
|
||||
UI_Signal signal; // NOTE(rjf): output, from build
|
||||
@@ -7081,6 +7082,7 @@ rd_window_frame(void)
|
||||
t->rect = rect;
|
||||
t->is_focused = ws->hover_eval_focused;
|
||||
t->is_anchored = 1;
|
||||
t->force_inside_window_x = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7244,7 +7246,8 @@ rd_window_frame(void)
|
||||
t->is_focused = 1;
|
||||
t->is_anchored = query_is_anchored;
|
||||
t->reset_open = reset_open;
|
||||
t->force_inside_window = 1;
|
||||
t->force_inside_window_x = 1;
|
||||
t->force_inside_window_y = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7273,14 +7276,19 @@ rd_window_frame(void)
|
||||
.initial = 0.f);
|
||||
|
||||
// rjf: force rect inside window if needed
|
||||
if(t->force_inside_window)
|
||||
if(t->force_inside_window_x || t->force_inside_window_y)
|
||||
{
|
||||
B32 axis_mask[] = {t->force_inside_window_x, t->force_inside_window_y};
|
||||
Rng2F32 window_rect = os_client_rect_from_window(ws->os);
|
||||
Vec2F32 max_delta = sub_2f32(rect.p1, window_rect.p1);
|
||||
Vec2F32 min_delta = sub_2f32(window_rect.p0, rect.p0);
|
||||
Vec2F32 total_delta = v2f32(Max(min_delta.x, 0) - Max(max_delta.x, 0),
|
||||
Max(min_delta.y, 0) - Max(max_delta.y, 0));
|
||||
rect = shift_2f32(rect, total_delta);
|
||||
for EachEnumVal(Axis2, axis)
|
||||
{
|
||||
if(!axis_mask[axis]) { continue; }
|
||||
F32 max_delta = rect.p1.v[axis] - window_rect.p1.v[axis];
|
||||
F32 min_delta = window_rect.p0.v[axis] - rect.p0.v[axis];
|
||||
F32 total_delta = Max(min_delta, 0) - Max(max_delta, 0);
|
||||
rect.p0.v[axis] += total_delta;
|
||||
rect.p1.v[axis] += total_delta;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: push view regs
|
||||
|
||||
Reference in New Issue
Block a user