Fix T43128: Headerless panels are reorderable on Windows

Seems like a weird issue, but to sort panels "qsort" is used, which works slightly different on Windows. So all I had
to do was cleaning up the logic in find_highest_panel so that headerless panels are sorted, but that it absolutly not
allows headerless panels to be above normal panels.
I made sure it works fine on Linux as well.
This commit is contained in:
julianeisel 2015-01-13 03:29:25 +01:00
parent aca329ba64
commit f453df5b03
Notes: blender-bot 2023-02-14 09:39:03 +01:00
Referenced by issue #43128, Possibility to move a panel above first headerless one, in Physics buttons?
1 changed files with 7 additions and 3 deletions

View File

@ -753,9 +753,13 @@ static int find_highest_panel(const void *a1, const void *a2)
const PanelSort *ps1 = a1, *ps2 = a2;
/* stick uppermost header-less panels to the top of the region -
* prevent them from being sorted */
if (ps1->pa->sortorder < ps2->pa->sortorder && ps1->pa->type->flag & PNL_NO_HEADER) return -1;
* prevent them from being sorted (multiple header-less panels have to be sorted though) */
if (ps1->pa->type->flag & PNL_NO_HEADER && ps2->pa->type->flag & PNL_NO_HEADER) {
/* skip and check for ofs and sortorder below */
}
else if (ps1->pa->type->flag & PNL_NO_HEADER) return -1;
else if (ps2->pa->type->flag & PNL_NO_HEADER) return 1;
if (ps1->pa->ofsy + ps1->pa->sizey < ps2->pa->ofsy + ps2->pa->sizey) return 1;
else if (ps1->pa->ofsy + ps1->pa->sizey > ps2->pa->ofsy + ps2->pa->sizey) return -1;
else if (ps1->pa->sortorder > ps2->pa->sortorder) return 1;