Skip to content
Myr

icon: try a minimum-diff search before we do a range search

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Daniel Eklöf · committed by Daniel Eklöf · parent 42dd074 · Browse files · 1 file+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−6 removed

  • other:+6 added−6 removed

1 file+6 added−6 removed

modified:xdg.c+6 added-6 removed
39 unmodified lines
40 /* Looking for *exactly* our wanted size */41 if (diff < min_diff)42 min_diff = diff;43 continue;44 } else if (i == 1 && diff != min_diff) {45 /* Try the one which matches most closely */46 continue;44 } else if (i == 1 && (icon_size < it->item.min_size ||47 } else if (i == 2 && (icon_size < it->item.min_size ||48 icon_size > it->item.max_size))49 {50 /* Find one whose scalable range we're in */51 continue;49 } else if (i == 2 && diff != min_diff) {50 /* Try the one which matches most closely */51 continue;52 } else {53 /* Use anyone available */54 }55
9 unmodified lines
65 if (cairo_surface_status(surf) == CAIRO_STATUS_SUCCESS) {66 if (i == 0)67 LOG_DBG("%s: %s: exact match", name, full_path);68 else if (i == 1)69 LOG_DBG("%s: %s: diff = %d", name, full_path, diff);70 else if (i == 2)71 LOG_DBG("%s: %s: range %d-%d",72 name, full_path,73 it->item.min_size, it->item.max_size);72 else if (i == 2)73 LOG_DBG("%s: %s: diff = %d", name, full_path, diff);74 else75 LOG_DBG("%s: %s: nothing else matched", name, full_path);7677 free(full_path);
243 unmodified lines