bugfix [#20944] bad use of wm.invoke_popup(self) is crashing Blender
This commit is contained in:
@@ -372,12 +372,16 @@ static void ui_popup_bounds_block(const bContext *C, uiBlock *block, int bounds_
|
||||
/* and we adjust the position to fit within window */
|
||||
width= block->maxx - block->minx;
|
||||
height= block->maxy - block->miny;
|
||||
|
||||
/* avoid divide by zero below, caused by calling with no UI, but better not crash */
|
||||
oldwidth= oldwidth > 0 ? oldwidth : MAX2(1, width);
|
||||
oldheight= oldheight > 0 ? oldheight : MAX2(1, height);
|
||||
|
||||
/* offset block based on mouse position, user offset is scaled
|
||||
along in case we resized the block in ui_text_bounds_block */
|
||||
startx= window->eventstate->x + block->minx + (block->mx*width)/oldwidth;
|
||||
starty= window->eventstate->y + block->miny + (block->my*height)/oldheight;
|
||||
|
||||
|
||||
if(startx<10)
|
||||
startx= 10;
|
||||
if(starty<10)
|
||||
|
||||
Reference in New Issue
Block a user