Merge branch 'master' into 1.1

# Conflicts:
#	.gitignore
This commit is contained in:
Wojtek Figat
2021-03-07 10:04:44 +01:00
2 changed files with 30 additions and 5 deletions

View File

@@ -379,9 +379,8 @@ void VisjectExecutor::ProcessGroupMath(Box* box, Node* node, Value& value)
const Vector2 rangeB = tryGetValue(node->GetBox(2), node->Values[2]).AsVector2();
const bool clamp = tryGetValue(node->GetBox(3), node->Values[3]).AsBool;
auto mapFunc = rangeB.X + (inVal - rangeA.X) * (rangeB.Y - rangeB.X) / (rangeA.Y - rangeA.X);
auto mapFunc = Math::Remap(inVal, rangeA.X, rangeA.Y, rangeB.X, rangeB.Y);
// Clamp value?
value = clamp ? Math::Clamp(mapFunc, rangeB.X, rangeB.Y) : mapFunc;
break;
}