mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-20 19:43:01 +00:00
A little hack so colors with alpha == 0 compare equal regardless of the
A little hack so colors with alpha == 0 compare equal regardless of the other color bytes. --klm
This commit is contained in:
parent
8873e7553a
commit
9b90608c60
|
@ -1,3 +1,8 @@
|
|||
1999-10-07 Kelly Lynn Martin <kelly@poverty.bloomington.in.us>
|
||||
|
||||
* plug-ins/common/autocrop.c (colors_equal): little hack so that
|
||||
all colors with alpha == 0 compare equal
|
||||
|
||||
1999-10-3 Simon Budig <Simon.Budig@unix-ag.org>
|
||||
|
||||
* app/path_tool.h
|
||||
|
|
|
@ -261,9 +261,16 @@ static int guess_bgcolor(GPixelRgn *pr, int width, int height, int bytes,
|
|||
}
|
||||
}
|
||||
|
||||
static int colors_equal(guchar *col1, guchar *col2, int bytes) {
|
||||
static int
|
||||
colors_equal(guchar *col1, guchar *col2, int bytes) {
|
||||
int equal = 1;
|
||||
int b;
|
||||
|
||||
if ((bytes == 2 || bytes == 4) && /* HACK! */
|
||||
col1[bytes-1] == 0 &&
|
||||
col2[bytes-1] == 0) {
|
||||
return 1; /* handle zero alpha */
|
||||
}
|
||||
|
||||
for (b = 0; b < bytes; b++) {
|
||||
if (col1[b] != col2[b]) {
|
||||
|
|
Loading…
Reference in a new issue