Fix #33875: minimize stretch UV tool incremented in steps of 0.2 instead of 0.1,

and now also shows the shortcut keys for setting the blend value.
This commit is contained in:
Brecht Van Lommel
2013-01-15 11:14:27 +00:00
parent 7aa9401a08
commit 600b2ad012

View File

@@ -603,7 +603,7 @@ static void minimize_stretch_iteration(bContext *C, wmOperator *op, int interact
param_flush(ms->handle);
if (sa) {
BLI_snprintf(str, sizeof(str), "Minimize Stretch. Blend %.2f", ms->blend);
BLI_snprintf(str, sizeof(str), "Minimize Stretch. Blend %.2f (Press + and -, or scroll wheel to set)", ms->blend);
ED_area_headerprint(sa, str);
}
@@ -686,20 +686,24 @@ static int minimize_stretch_modal(bContext *C, wmOperator *op, wmEvent *event)
return OPERATOR_FINISHED;
case PADPLUSKEY:
case WHEELUPMOUSE:
if (ms->blend < 0.95f) {
ms->blend += 0.1f;
ms->lasttime = 0.0f;
RNA_float_set(op->ptr, "blend", ms->blend);
minimize_stretch_iteration(C, op, 1);
if(event->val == KM_PRESS) {
if (ms->blend < 0.95f) {
ms->blend += 0.1f;
ms->lasttime = 0.0f;
RNA_float_set(op->ptr, "blend", ms->blend);
minimize_stretch_iteration(C, op, 1);
}
}
break;
case PADMINUS:
case WHEELDOWNMOUSE:
if (ms->blend > 0.05f) {
ms->blend -= 0.1f;
ms->lasttime = 0.0f;
RNA_float_set(op->ptr, "blend", ms->blend);
minimize_stretch_iteration(C, op, 1);
if(event->val == KM_PRESS) {
if (ms->blend > 0.05f) {
ms->blend -= 0.1f;
ms->lasttime = 0.0f;
RNA_float_set(op->ptr, "blend", ms->blend);
minimize_stretch_iteration(C, op, 1);
}
}
break;
case TIMER: