[patch] prevent sign extended alpha values

Eric Blake ebb9@byu.net
Sun Aug 10 02:51:00 GMT 2003


graydon hoare wrote:
> trivial fix to make colors with alpha work. ok to commit?

> -    return (getRGB() & ALPHA_MASK) >> 24;
> +    return ((getRGB() & ALPHA_MASK) >> 24) & 0xff;

Why not simplify:
        return (getRGB() & ALPHA_MASK) >>> 24;

-- 
Someday, I might put a cute statement here.

Eric Blake             ebb9@byu.net



More information about the Java-patches mailing list