diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-11-19 00:22:37 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-11-19 00:22:37 -0500 |
commit | b1c833c4061a6e3e4980d75f8213b558a4e8137d (patch) | |
tree | 8a4497564bc3b3265bb6c89538585fefbb929802 /libdimension | |
parent | 5a5db9a64a0b47c7f61626a8f4e347834b903b5b (diff) | |
download | dimension-b1c833c4061a6e3e4980d75f8213b558a4e8137d.tar.xz |
Calculate .filter and .trans correctly in dmnsn_color_filter().
Diffstat (limited to 'libdimension')
-rw-r--r-- | libdimension/color.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libdimension/color.c b/libdimension/color.c index 12edb20..15c6150 100644 --- a/libdimension/color.c +++ b/libdimension/color.c @@ -382,7 +382,11 @@ dmnsn_color_filter(dmnsn_color color, dmnsn_color filter) dmnsn_color transmitted = dmnsn_color_mul(filter.trans, color); dmnsn_color filtered = dmnsn_color_mul(filter.filter, dmnsn_color_illuminate(filter, color)); - return dmnsn_color_add(transmitted, filtered); + + dmnsn_color ret = dmnsn_color_add(transmitted, filtered); + ret.filter = filter.filter*color.filter; + ret.trans = filter.trans*color.trans; + return ret; } /* Illuminates `color' with `light' */ |