Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
fix changing display mode or range not propagating to inner control, f…
Browse files Browse the repository at this point in the history
…ixes #109
  • Loading branch information
cpdt committed Oct 28, 2018
1 parent 64d3474 commit b50c6e1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions editor/model/objects/NumControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,27 @@ QString NumControl::debugName() {
}

void NumControl::setDisplayMode(AxiomModel::NumControl::DisplayMode displayMode) {
// if we're exposing, set it on the underlying control
if (!exposingUuid().isNull()) {
auto exposingControl = dynamic_cast<NumControl *>(find(root()->controls().sequence(), exposingUuid()));
assert(exposingControl);
exposingControl->setDisplayMode(displayMode);
}

if (displayMode != _displayMode) {
_displayMode = displayMode;
displayModeChanged(displayMode);
}
}

void NumControl::setRange(float minValue, float maxValue, uint32_t step) {
// if we're exposing, set it on the underlying control
if (!exposingUuid().isNull()) {
auto exposingControl = dynamic_cast<NumControl *>(find(root()->controls().sequence(), exposingUuid()));
assert(exposingControl);
exposingControl->setRange(minValue, maxValue, step);
}

if (minValue != _minValue || maxValue != _maxValue || step != _step) {
_minValue = minValue;
_maxValue = maxValue;
Expand Down

0 comments on commit b50c6e1

Please sign in to comment.