don't deadlock

This commit is contained in:
Roland Fredenhagen 2023-11-12 02:23:05 +01:00
parent a5dfd06f90
commit af835b7474
No known key found for this signature in database
GPG key ID: 094AF99241035EB6

View file

@ -47,8 +47,9 @@ macro_rules! define_components {
};
($type:ty, contrasting!($bg:ident, $($fg:ident),+ $(,)?)) => {
define_components!($type, |context| {
context.query_style(&$bg).most_contrasting(&[
$(context.query_style(&$fg)),+
let styles = context.query_styles(&[&$bg, $(&$fg),*]);
styles.get(&$bg, context).most_contrasting(&[
$(styles.get(&$fg, context)),+
])
});
};