Fix a slight bug (causing possible miscoloring of parts of the titlebar)

2005-07-13  Elijah Newren  <newren@gmail.com>

	Fix a slight bug (causing possible miscoloring of parts of the
	titlebar) introduced by the patch from #169982.

	* src/gradient.c:
	(meta_gradient_create_interwoven):
	(meta_gradient_create_multi_vertical):

	bitshifting operators do not take precedence over typecasting, so
	make sure to use parentheses to get the right operation order.
This commit is contained in:
Elijah Newren 2005-07-13 18:24:56 +00:00 committed by Elijah Newren
parent 053c1b9d19
commit c635ac51cb
2 changed files with 21 additions and 9 deletions

View File

@ -1,3 +1,15 @@
2005-07-13 Elijah Newren <newren@gmail.com>
Fix a slight bug (causing possible miscoloring of parts of the
titlebar) introduced by the patch from #169982.
* src/gradient.c:
(meta_gradient_create_interwoven):
(meta_gradient_create_multi_vertical):
bitshifting operators do not take precedence over typecasting, so
make sure to use parentheses to get the right operation order.
2005-07-12 Elijah Newren <newren@gmail.com>
* configure.in: post-release version bump to 2.11.1

View File

@ -198,15 +198,15 @@ meta_gradient_create_interwoven (int width,
if (k == 0)
{
ptr[0] = (unsigned char) r1>>16;
ptr[1] = (unsigned char) g1>>16;
ptr[2] = (unsigned char) b1>>16;
ptr[0] = (unsigned char) (r1>>16);
ptr[1] = (unsigned char) (g1>>16);
ptr[2] = (unsigned char) (b1>>16);
}
else
{
ptr[0] = (unsigned char) r2>>16;
ptr[1] = (unsigned char) g2>>16;
ptr[2] = (unsigned char) b2>>16;
ptr[0] = (unsigned char) (r2>>16);
ptr[1] = (unsigned char) (g2>>16);
ptr[2] = (unsigned char) (b2>>16);
}
for (j=1; j <= width/2; j *= 2)
@ -589,9 +589,9 @@ meta_gradient_create_multi_vertical (int width, int height,
{
tmp = ptr;
ptr[0] = (unsigned char) r>>16;
ptr[1] = (unsigned char) g>>16;
ptr[2] = (unsigned char) b>>16;
ptr[0] = (unsigned char) (r>>16);
ptr[1] = (unsigned char) (g>>16);
ptr[2] = (unsigned char) (b>>16);
for (x=1; x <= width/2; x *= 2)
memcpy (&(ptr[x*3]), ptr, x*3);