summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-11-19 00:22:37 -0500
committerTavian Barnes <tavianator@gmail.com>2009-11-19 00:22:37 -0500
commitb1c833c4061a6e3e4980d75f8213b558a4e8137d (patch)
tree8a4497564bc3b3265bb6c89538585fefbb929802
parent5a5db9a64a0b47c7f61626a8f4e347834b903b5b (diff)
downloaddimension-b1c833c4061a6e3e4980d75f8213b558a4e8137d.tar.xz
Calculate .filter and .trans correctly in dmnsn_color_filter().
-rw-r--r--libdimension/color.c6
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' */