Bug fix #2535
Armatures with > 100 bones can deliver a 'parent IK menu' that doesn't fit on screen anymore. Fixed it with changes; - when menu doesnt fit to right/left, it places it aligned to left hand of window - when more than 8 collums in a menu exist, it makes collums 25 items instead of 20. Also fixed for the popup menu on Bone parenting. On a 1280 screen we now can have a menu with over 300 bones (even more when you zoom down the buttons window a bit). Still not optimal, but at least it's less annoying.
This commit is contained in:
@@ -431,7 +431,7 @@ static int ui_but_copy_paste(uiBut *but, char mode)
|
||||
static float rgb[3];
|
||||
void *poin;
|
||||
|
||||
if(mode=='v' && but->lock) return;
|
||||
if(mode=='v' && but->lock) return 0;
|
||||
|
||||
poin= but->poin;
|
||||
|
||||
@@ -704,7 +704,7 @@ static void ui_positionblock(uiBlock *block, uiBut *but)
|
||||
}
|
||||
}
|
||||
|
||||
/* and now we handle the exception; no space below or to right */
|
||||
/* and now we handle the exception; no space below or to top */
|
||||
if(top==0 && down==0) {
|
||||
if(dir1==UI_LEFT || dir1==UI_RIGHT) {
|
||||
// align with bottom of screen
|
||||
@@ -712,6 +712,14 @@ static void ui_positionblock(uiBlock *block, uiBut *but)
|
||||
}
|
||||
}
|
||||
|
||||
/* or no space left or right */
|
||||
if(left==0 && right==0) {
|
||||
if(dir1==UI_TOP || dir1==UI_DOWN) {
|
||||
// align with left size of screen
|
||||
xof= -block->minx+5;
|
||||
}
|
||||
}
|
||||
|
||||
// apply requested offset in the block
|
||||
xof += block->xofs/block->aspect;
|
||||
yof += block->yofs/block->aspect;
|
||||
@@ -1101,6 +1109,8 @@ static int ui_do_but_MENU(uiBut *but)
|
||||
columns= (md->nitems+20)/20;
|
||||
if (columns<1) columns= 1;
|
||||
|
||||
if(columns>8) columns= (md->nitems+25)/25;
|
||||
|
||||
rows= (int) md->nitems/columns;
|
||||
if (rows<1) rows= 1;
|
||||
|
||||
@@ -5112,6 +5122,11 @@ short pupmenu_col(char *instr, int maxrow)
|
||||
columns= (md->nitems+maxrow)/maxrow;
|
||||
if (columns<1) columns= 1;
|
||||
|
||||
if(columns > 8) {
|
||||
maxrow += 5;
|
||||
columns= (md->nitems+maxrow)/maxrow;
|
||||
}
|
||||
|
||||
rows= (int) md->nitems/columns;
|
||||
if (rows<1) rows= 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user