Skip to content

Commit d820dea

Browse files
seangoodvibesm-m-adams
authored andcommitted
Adjust display of negative values (#1530)
Adjusted display of negative values in mod matrix menu so that 1 decimal place is not cut off.
1 parent 6549cbb commit d820dea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/deluge/gui/menu_item/patch_cables.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ void PatchCables::renderOptions() {
8080
int32_t param_value = cable->param.getCurrentValue();
8181
int32_t level = ((int64_t)param_value * kMaxMenuPatchCableValue + (1 << 29)) >> 30;
8282

83-
floatToString((float)level / 100, buf + off + 5, 2, 2);
83+
float floatLevel = (float)level / 100;
84+
int floatoff = floatLevel < 0 ? 1 : 0;
85+
86+
floatToString(floatLevel, buf + off + 5 - floatoff, 2, 2);
8487
// fmt::vformat_to_n(buf + off + 5, 5, "{:4}", fmt::make_format_args();
8588

8689
buf[off + 9] = ' ';

0 commit comments

Comments
 (0)