code cleanup: remove pointless casts (int -> short -> int)
This commit is contained in:
@@ -221,8 +221,10 @@ static void node_draw_output_default(const bContext *C, uiBlock *block,
|
|||||||
ofs++;
|
ofs++;
|
||||||
slen = snode->aspect_sqrt * UI_GetStringWidth(ui_name + ofs);
|
slen = snode->aspect_sqrt * UI_GetStringWidth(ui_name + ofs);
|
||||||
}
|
}
|
||||||
uiDefBut(block, LABEL, 0, ui_name + ofs, (short)(sock->locx - (15.0f * snode->aspect_sqrt) - slen), (short)(sock->locy - 9.0f),
|
uiDefBut(block, LABEL, 0, ui_name + ofs,
|
||||||
(short)(node->width - NODE_DY), NODE_DY, NULL, 0, 0, 0, 0, "");
|
(int)(sock->locx - (15.0f * snode->aspect_sqrt) - slen), (int)(sock->locy - 9.0f),
|
||||||
|
(short)(node->width - NODE_DY), (short)NODE_DY,
|
||||||
|
NULL, 0, 0, 0, 0, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ****************** BASE DRAW FUNCTIONS FOR NEW OPERATOR NODES ***************** */
|
/* ****************** BASE DRAW FUNCTIONS FOR NEW OPERATOR NODES ***************** */
|
||||||
@@ -387,8 +389,8 @@ static void node_buts_normal(uiLayout *layout, bContext *UNUSED(C), PointerRNA *
|
|||||||
uiBut *bt;
|
uiBut *bt;
|
||||||
|
|
||||||
bt = uiDefButF(block, BUT_NORMAL, B_NODE_EXEC, "",
|
bt = uiDefButF(block, BUT_NORMAL, B_NODE_EXEC, "",
|
||||||
(short)butr->xmin, (short)butr->xmin,
|
(int)butr->xmin, (int)butr->xmin,
|
||||||
butr->xmax - butr->xmin, butr->xmax - butr->xmin,
|
(short)(butr->xmax - butr->xmin), (short)(butr->xmax - butr->xmin),
|
||||||
nor, 0.0f, 1.0f, 0, 0, "");
|
nor, 0.0f, 1.0f, 0, 0, "");
|
||||||
uiButSetFunc(bt, node_normal_cb, ntree, node);
|
uiButSetFunc(bt, node_normal_cb, ntree, node);
|
||||||
}
|
}
|
||||||
@@ -827,7 +829,8 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
|
|||||||
/* backdrop title */
|
/* backdrop title */
|
||||||
UI_ThemeColor(TH_TEXT_HI);
|
UI_ThemeColor(TH_TEXT_HI);
|
||||||
|
|
||||||
layout = uiBlockLayout(gnode->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, (short)(rect.xmin + 15), (short)(rect.ymax + group_header),
|
layout = uiBlockLayout(gnode->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL,
|
||||||
|
(int)(rect.xmin + 15), (int)(rect.ymax + group_header),
|
||||||
MIN2((int)(rect.xmax - rect.xmin - 18.0f), node_group_frame + 20), group_header, UI_GetStyle());
|
MIN2((int)(rect.xmax - rect.xmin - 18.0f), node_group_frame + 20), group_header, UI_GetStyle());
|
||||||
RNA_pointer_create(&ntree->id, &RNA_Node, gnode, &ptr);
|
RNA_pointer_create(&ntree->id, &RNA_Node, gnode, &ptr);
|
||||||
uiTemplateIDBrowse(layout, (bContext *)C, &ptr, "node_tree", NULL, NULL, NULL);
|
uiTemplateIDBrowse(layout, (bContext *)C, &ptr, "node_tree", NULL, NULL, NULL);
|
||||||
|
@@ -797,8 +797,10 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
|
|||||||
//if (node->flag & NODE_MUTED)
|
//if (node->flag & NODE_MUTED)
|
||||||
// BLI_snprintf(showname, sizeof(showname), "[%s]", showname); // XXX - don't print into self!
|
// BLI_snprintf(showname, sizeof(showname), "[%s]", showname); // XXX - don't print into self!
|
||||||
|
|
||||||
uiDefBut(node->block, LABEL, 0, showname, (short)(rct->xmin+15), (short)(rct->ymax-NODE_DY),
|
uiDefBut(node->block, LABEL, 0, showname,
|
||||||
(int)(iconofs - rct->xmin-18.0f), NODE_DY, NULL, 0, 0, 0, 0, "");
|
(int)(rct->xmin + 15), (int)(rct->ymax - NODE_DY),
|
||||||
|
(short)(iconofs - rct->xmin - 18.0f), (short)NODE_DY,
|
||||||
|
NULL, 0, 0, 0, 0, "");
|
||||||
|
|
||||||
/* body */
|
/* body */
|
||||||
if (node->flag & NODE_CUSTOM_COLOR)
|
if (node->flag & NODE_CUSTOM_COLOR)
|
||||||
@@ -946,8 +948,10 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
|
|||||||
//if (node->flag & NODE_MUTED)
|
//if (node->flag & NODE_MUTED)
|
||||||
// BLI_snprintf(showname, sizeof(showname), "[%s]", showname); // XXX - don't print into self!
|
// BLI_snprintf(showname, sizeof(showname), "[%s]", showname); // XXX - don't print into self!
|
||||||
|
|
||||||
uiDefBut(node->block, LABEL, 0, showname, (short)(rct->xmin+15), (short)(centy-10),
|
uiDefBut(node->block, LABEL, 0, showname,
|
||||||
(int)(rct->xmax - rct->xmin-18.0f -12.0f), NODE_DY, NULL, 0, 0, 0, 0, "");
|
(int)(rct->xmin + 15), (int)(centy - 10),
|
||||||
|
(short)(rct->xmax - rct->xmin-18.0f -12.0f), (short)NODE_DY,
|
||||||
|
NULL, 0, 0, 0, 0, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* scale widget thing */
|
/* scale widget thing */
|
||||||
|
Reference in New Issue
Block a user