Page MenuHome

Fix T85368:Map Range Node Clamp Functionality
ClosedPublic

Authored by Sam Miller (samuelmiller) on Feb 5 2021, 2:23 PM.

Details

Summary

This patch address: T85368 Fix Map Range Node Clamp Functionality

The clamp was not working correctly because it used hard-coded values.

The clamp will now use input values from the To field.

Diff Detail

Event Timeline

This assumes that to_min is less than to_max which may not be the case.

See original Map Range patch D5827 to see correct behaviour Result = (type == "range" && (Min > Max)) ? clamp(Value, Max, Min) : clamp(Value, Min, Max);

Sam Miller (samuelmiller) updated this revision to Diff 33640.EditedFeb 5 2021, 7:00 PM

Thank you for the reference. The clamp function does not seem to be available in scope here so I'm using clamp_f. The original CLAMP does not work with the tertiary operation.

Sam Miller (samuelmiller) retitled this revision from Fix Map Range Node Clamp Functionality to Fix T85368:Map Range Node Clamp Functionality.Feb 5 2021, 8:10 PM
This revision is now accepted and ready to land.Feb 8 2021, 1:25 PM