Skip to content

Commit

Permalink
toggle within host: 0.5 as value threshold
Browse files Browse the repository at this point in the history
closes #38
  • Loading branch information
drlight-code committed Apr 12, 2020
1 parent 1ce4bb0 commit e673326
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/ControlElementHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ parameterValueChanged
float outValue = createInfo.range.first +
(createInfo.range.second - createInfo.range.first) * value;

sendValue.setValue(outValue);
if (createInfo.type == Type::Toggle) {
sendValue.setValue (value >= 0.5f);
}
else {
sendValue.setValue (outValue);
}
}

void
Expand Down

0 comments on commit e673326

Please sign in to comment.