[ui, styling]Fix order of adding after rules to running list in rule-matching pass

This commit is contained in:
Martin Fouilleul 2023-03-11 16:43:58 +01:00
parent bf92a6f307
commit 009fe8e3e8
1 changed files with 15 additions and 15 deletions

View File

@ -903,33 +903,33 @@ void ui_styling_prepass(ui_context* ui, ui_box* box, list_info* before, list_inf
UI_STYLE_MASK_INHERITED); UI_STYLE_MASK_INHERITED);
} }
//NOTE: match rules
//NOTE: append box before rules to before and tmp
list_info tmpBefore = {0}; list_info tmpBefore = {0};
for_list(before, rule, ui_style_rule, buildElt)
{
ui_style_rule_match(ui, box, rule, before, &tmpBefore);
}
for_list(&box->beforeRules, rule, ui_style_rule, boxElt) for_list(&box->beforeRules, rule, ui_style_rule, boxElt)
{ {
list_append(before, &rule->buildElt); list_append(before, &rule->buildElt);
list_append(&tmpBefore, &rule->tmpElt); list_append(&tmpBefore, &rule->tmpElt);
}
//NOTE: match before rules
for_list(before, rule, ui_style_rule, buildElt)
{
ui_style_rule_match(ui, box, rule, before, &tmpBefore); ui_style_rule_match(ui, box, rule, before, &tmpBefore);
} }
////////////////////////////////////////////////////////////////// //NOTE: prepend box after rules to after and append them to tmp
//TODO: shouldn't this be reversed???
//////////////////////////////////////////////////////////////////
list_info tmpAfter = {0}; list_info tmpAfter = {0};
for_list_reverse(&box->afterRules, rule, ui_style_rule, boxElt)
{
list_push(after, &rule->buildElt);
list_append(&tmpAfter, &rule->tmpElt);
}
//NOTE: match after rules
for_list(after, rule, ui_style_rule, buildElt) for_list(after, rule, ui_style_rule, buildElt)
{ {
ui_style_rule_match(ui, box, rule, after, &tmpAfter); ui_style_rule_match(ui, box, rule, after, &tmpAfter);
} }
for_list(&box->afterRules, rule, ui_style_rule, boxElt)
{
list_append(after, &rule->buildElt);
list_append(&tmpAfter, &rule->tmpElt);
ui_style_rule_match(ui, box, rule, after, &tmpAfter);
}
//NOTE: compute static sizes //NOTE: compute static sizes
ui_box_animate_style(ui, box); ui_box_animate_style(ui, box);
@ -2016,7 +2016,7 @@ typedef struct ui_edit_command
#if OS_WIN64 #if OS_WIN64
#define OS_COPY_PASTE_MOD MP_KEYMOD_CTRL #define OS_COPY_PASTE_MOD MP_KEYMOD_CTRL
#elif OS_MACOS #elif OS_MACOS
#define OS_COPY_PAST_MOD MP_KEYMOD_CMD #define OS_COPY_PASTE_MOD MP_KEYMOD_CMD
#endif #endif
const ui_edit_command UI_EDIT_COMMANDS[] = { const ui_edit_command UI_EDIT_COMMANDS[] = {