diff options
author | Richard Grenville <[email protected]> | 2012-09-12 21:01:06 +0800 |
---|---|---|
committer | Richard Grenville <[email protected]> | 2012-09-12 21:01:06 +0800 |
commit | 73342d1ff233aa74999998e8cf628d8e956d394f (patch) | |
tree | cf0bd3bd6cd0c645e21620b48f02c2bdbb0b95d6 /compton.h | |
parent | 17b8a50161ab84a7b1d05d69b14a81d9a98e4432 (diff) | |
download | tdebase-73342d1ff233aa74999998e8cf628d8e956d394f.tar.gz tdebase-73342d1ff233aa74999998e8cf628d8e956d394f.zip |
Bug fix: Issue #40: -z does not work as expected
More information in the issue report.
- Let window opacity affect the opacity of its shadow and frames even if
-z is enabled.
- Check for the range of -o to eliminate potential segfault.
Diffstat (limited to 'compton.h')
-rw-r--r-- | compton.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -153,6 +153,23 @@ extern int root_height, root_width; // http://clang.llvm.org/compatibility.html#inline /** + * Normalize an int value to a specific range. + * + * @param i int value to normalize + * @param min minimal value + * @param max maximum value + * @return normalized value + */ +static inline double normalize_i_range(int i, int min, int max) { + if (i > max) + return max; + if (i < min) + return min; + + return i; +} + +/** * Normalize a double value to 0.\ 0 - 1.\ 0. * * @param d double value to normalize |