Bugfix #19887: Blender crash when resizing nodes in node editor

This commit fixes the crash, but there are currently some issues with getting the active node in general with the Nodes Editor.
This commit is contained in:
2009-11-15 11:32:29 +00:00
parent 6468f21ddf
commit 61fe981a0f

View File

@@ -1169,13 +1169,15 @@ static int node_resize_modal(bContext *C, wmOperator *op, wmEvent *event)
UI_view2d_region_to_view(&ar->v2d, event->x - ar->winrct.xmin, event->y - ar->winrct.ymin,
&mx, &my);
if(node->flag & NODE_HIDDEN) {
node->miniwidth= nsw->oldwidth + mx - nsw->mxstart;
CLAMP(node->miniwidth, 0.0f, 100.0f);
}
else {
node->width= nsw->oldwidth + mx - nsw->mxstart;
CLAMP(node->width, node->typeinfo->minwidth, node->typeinfo->maxwidth);
if (node) {
if(node->flag & NODE_HIDDEN) {
node->miniwidth= nsw->oldwidth + mx - nsw->mxstart;
CLAMP(node->miniwidth, 0.0f, 100.0f);
}
else {
node->width= nsw->oldwidth + mx - nsw->mxstart;
CLAMP(node->width, node->typeinfo->minwidth, node->typeinfo->maxwidth);
}
}
ED_region_tag_redraw(ar);