/* edit buttons proportionally to eachother
* note: if we mix buttons which are proportional and others which are not,
* this may work a bit strangely */
- if (but_active->rnaprop) {
- if ((data->origvalue != 0.0) && (RNA_property_flag(but_active->rnaprop) & PROP_PROPORTIONAL)) {
+ if ((but_active->rnaprop && (RNA_property_flag(but_active->rnaprop) & PROP_PROPORTIONAL)) ||
+ ELEM(but->unit_type, PROP_UNIT_LENGTH))
+ {
+ if (data->origvalue != 0.0) {
data->multi_data.is_proportional = true;
}
}
+
}
static void ui_multibut_states_apply(bContext *C, uiHandleButtonData *data, uiBlock *block)
UI_block_align_begin(block);
const float lim = 10000;
for (int i = 0; i < 3; i++) {
+ uiBut *but;
char text[3] = {'X' + i, ':', '\0'};
- uiDefButF(block, UI_BTYPE_NUM, B_TRANSFORM_PANEL_DIMS, text, 0, yi -= buth, butw, buth,
- &(tfp->ob_dims[i]), 0.0f, lim, 10, 3, "");
+ but = uiDefButF(
+ block, UI_BTYPE_NUM, B_TRANSFORM_PANEL_DIMS, text, 0, yi -= buth, butw, buth,
+ &(tfp->ob_dims[i]), 0.0f, lim, 10, 3, "");
+ UI_but_unit_type_set(but, PROP_UNIT_LENGTH);
}
UI_block_align_end(block);
}