Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_templates.c
| Show First 20 Lines • Show All 4,276 Lines • ▼ Show 20 Lines | bt = uiDefIconBut(block, | ||||
| TIP_("Delete points")); | TIP_("Delete points")); | ||||
| UI_but_funcN_set(bt, curvemap_buttons_delete, MEM_dupallocN(cb), cumap); | UI_but_funcN_set(bt, curvemap_buttons_delete, MEM_dupallocN(cb), cumap); | ||||
| UI_block_emboss_set(block, UI_EMBOSS); | UI_block_emboss_set(block, UI_EMBOSS); | ||||
| UI_block_funcN_set(block, rna_update_cb, MEM_dupallocN(cb), NULL); | UI_block_funcN_set(block, rna_update_cb, MEM_dupallocN(cb), NULL); | ||||
| /* curve itself */ | /* curve itself */ | ||||
| size = uiLayoutGetWidth(layout); | size = MAX2(uiLayoutGetWidth(layout), UI_UNIT_X); | ||||
brecht: Use `max_ii` instead here.
It doesn't make much difference in this case, but in general it's… | |||||
| row = uiLayoutRow(layout, false); | row = uiLayoutRow(layout, false); | ||||
| uiDefBut( | uiDefBut( | ||||
| block, UI_BTYPE_CURVE, 0, "", 0, 0, size, 8.0f * UI_UNIT_X, cumap, 0.0f, 1.0f, bg, 0, ""); | block, UI_BTYPE_CURVE, 0, "", 0, 0, size, 8.0f * UI_UNIT_X, cumap, 0.0f, 1.0f, bg, 0, ""); | ||||
| /* sliders for selected point */ | /* sliders for selected point */ | ||||
| for (i = 0; i < cm->totpoint; i++) { | for (i = 0; i < cm->totpoint; i++) { | ||||
| if (cm->curve[i].flag & CUMA_SELECT) { | if (cm->curve[i].flag & CUMA_SELECT) { | ||||
| cmp = &cm->curve[i]; | cmp = &cm->curve[i]; | ||||
| ▲ Show 20 Lines • Show All 2,462 Lines • Show Last 20 Lines | |||||
Use max_ii instead here.
It doesn't make much difference in this case, but in general it's more efficient to use the function. The macro can call the uiLayoutGetWidth() function twice.