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.
This commit is contained in:
@ -152,6 +152,23 @@ extern int root_height, root_width;
|
||||
// inline functions must be made static to compile correctly under clang:
|
||||
// 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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user