math: fixed power function

Corrected shader code and fixed bug in widget bridge that reported an
incorrect index.
This commit is contained in:
itsmattkc
2020-07-17 12:33:28 +10:00
parent 662d66ad10
commit 6309b8fbb7
2 changed files with 21 additions and 2 deletions
@@ -363,7 +363,17 @@ void NodeParamViewWidgetBridge::WidgetCallback()
case NodeParam::kCombo:
{
// Widget is a QComboBox
SetInputValue(static_cast<QComboBox*>(widgets_.first())->currentIndex(), 0);
QComboBox* cb = static_cast<QComboBox*>(widgets_.first());
int index = cb->currentIndex();
// Subtract any splitters up until this point
for (int i=index-1; i>=0; i--) {
if (cb->itemData(i, Qt::AccessibleDescriptionRole).toString() == QStringLiteral("separator")) {
index--;
}
}
SetInputValue(index, 0);
break;
}
}