fix for 2 bugs in own recent commits,
- 29881 broke BLI_stringdec in some cases. - poll function for view home crashed view menu because the rv3d isnt available (still needs fixing).
This commit is contained in:
@@ -105,12 +105,18 @@ int BLI_stringdec(const char *string, char *head, char *tail, unsigned short *nu
|
||||
}
|
||||
if (found) {
|
||||
if (tail) strcpy(tail, &string[nume+1]);
|
||||
if (head) BLI_strncpy(head, string, nums);
|
||||
if (head) {
|
||||
strcpy(head,string);
|
||||
head[nums]=0;
|
||||
}
|
||||
if (numlen) *numlen = nume-nums+1;
|
||||
return ((int)atoi(&(string[nums])));
|
||||
}
|
||||
if (tail) strcpy(tail, string + len);
|
||||
if (head) BLI_strncpy(head, string, nums);
|
||||
if (head) {
|
||||
strncpy(head, string, len);
|
||||
head[len] = '\0';
|
||||
}
|
||||
if (numlen) *numlen=0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1309,8 +1309,8 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.
|
||||
static int viewhome_poll(bContext *C)
|
||||
{
|
||||
if(ED_operator_view3d_active(C)) {
|
||||
RegionView3D *rv3d= CTX_wm_region_view3d(C);
|
||||
if(rv3d->persp!=RV3D_CAMOB) {
|
||||
RegionView3D *rv3d= CTX_wm_region_view3d(C); //XXX, when accessed from a header menu this doesnt work!
|
||||
if(rv3d && rv3d->persp!=RV3D_CAMOB) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user