[PATCH weston] cairo-util: fix shadows for small clients

Bill Spitzak spitzak at gmail.com
Mon Oct 27 10:50:10 PDT 2014



On 10/15/2014 01:16 AM, Marek Chalupa wrote:
>  +			shadow_height = height / 2;
> +
> +			/* when the height is odd, we need some part of the
> +			 * shadow to be one pixel higher. Let's choose the
> +			 * upper one */
> +			if (height % 2 != 0 && !fy)
> +				++shadow_height;

This does the same thing:
			shadow_height = (height + (fy ? 0 : 1)) / 2;

If there is any chance height is negative you want to use >>1 rather 
than /2. This is because it always rounds in the same direction (down 
rather than toward zero). I don't think negative height happens here, 
however.


More information about the wayland-devel mailing list