Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1486

General Discussion • Re: Clamp and Shape % problems.

$
0
0
I've not long started and am stuck as to why the Clamp function isn't working correctly. It allows the setting to go below zero, to -5 and up to 260 despite being clamped from 0-255. What's wrong here that doesn't affect the other skins I use it on? I just don't get it! :confused:
Your code logic is what's wrong here, not the Clamp() function. How do you expect to have 0 to 255 results if in the 2nd bang you keep adding (and subtracting, in the other mouse scroll action) 5 to the correctly clamped value from the 1st bang?

Code:

MouseScrollUpAction=[!SetVariable #CURRENTSECTION# (Clamp([#[#CURRENTSECTION]],0,255))][!SetVariable #CURRENTSECTION# ([#[#CURRENTSECTION]]+5)]
To do what you said you wanted to do, you should probably get rid of the 1st bang and apply the Clamp() to the sum (or difference, in the other mouse scroll action) from the 2nd bang. If I understood your intention correctly, that is.

I won't talk about percentages, the matter hardly requires any explanation, really. Plus, you seem to have solved it already.

Statistics: Posted by Yincognito — Today, 6:11 pm



Viewing all articles
Browse latest Browse all 1486

Trending Articles