projects
/
geeqie
/
xcf-pixbuf-loader.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e43825e
)
revent a division by zero when both layers have an opacity of 0
author
Stephane Delcroix
<stephane@delcroix.org>
Fri, 20 Mar 2009 14:22:03 +0000
(15:22 +0100)
committer
Stephane Delcroix
<stephane@delcroix.org>
Fri, 20 Mar 2009 14:22:03 +0000
(15:22 +0100)
io-xcf.c
patch
|
blob
|
history
diff --git
a/io-xcf.c
b/io-xcf.c
index
68ea51c
..
3413420
100644
(file)
--- a/
io-xcf.c
+++ b/
io-xcf.c
@@
-296,6
+296,9
@@
intersect_tile (guchar* ptr, int im_width, int im_height, int *ox, int *oy, int
void blend (guchar* rgba0, guchar* rgba1)
{
+ if (rgba0[3] == 0 && rgba1[3] == 0)
+ return;
+
guchar k = 0xff * rgba1[3] / (0xff - (0xff-rgba0[3])*(0xff-rgba1[3])/0xff);
rgba0[0] = ((0xff - k) * rgba0[0] + k * rgba1[0]) / 0xff;
rgba0[1] = ((0xff - k) * rgba0[1] + k * rgba1[1]) / 0xff;