- Linking logic buttons had draw glitch, caused by reading
  data from free'd buttons
- Doing an undo with mouse-over Curve Widget caused crash or
  corruption.

Both related to code that tries to keep the "active" button in
memory. On each redraw of UI, buttons are re-created, which makes
it all tricky... hope we're safer now.

Also: added back undo pushes on adding links in logic editor.
This commit is contained in:
2011-03-01 12:25:55 +00:00
parent 1c0b9dfdf1
commit 5bf1bf645c
2 changed files with 45 additions and 200 deletions

View File

@@ -117,7 +117,6 @@ typedef struct uiHandleButtonData {
float vec[3], origvec[3];
int togdual, togonly;
ColorBand *coba;
CurveMapping *cumap;
/* tooltip */
ARegion *tooltip;
@@ -1874,8 +1873,7 @@ static void ui_numedit_begin(uiBut *but, uiHandleButtonData *data)
float softrange, softmin, softmax;
if(but->type == BUT_CURVE) {
data->cumap= (CurveMapping*)but->poin;
but->editcumap= data->cumap;
but->editcumap= (CurveMapping*)but->poin;
}
else if(but->type == BUT_COLORBAND) {
data->coba= (ColorBand*)but->poin;
@@ -3375,7 +3373,7 @@ static int ui_do_but_COLORBAND(bContext *C, uiBlock *block, uiBut *but, uiHandle
static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap, int mx, int my)
{
CurveMapping *cumap= data->cumap;
CurveMapping *cumap= (CurveMapping*)but->poin;
CurveMap *cuma= cumap->cm+cumap->cur;
CurveMapPoint *cmp= cuma->curve;
float fx, fy, zoomx, zoomy, offsx, offsy;
@@ -3565,7 +3563,7 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt
}
else if(event->type==LEFTMOUSE && event->val!=KM_PRESS) {
if(data->dragsel != -1) {
CurveMapping *cumap= data->cumap;
CurveMapping *cumap= (CurveMapping*)but->poin;
CurveMap *cuma= cumap->cm+cumap->cur;
CurveMapPoint *cmp= cuma->curve;