Improper alpha value handling.
Created by: ca1ek
I got code like this
let Wallpaper { mut image, data } = wallpaper;
let mut mask = Image::from_color(160, 90, Color::rgb(255, 255, 255));
mask.rounded_rect(2, 2, 156, 86, 5, true, Color::rgba(0, 0, 0, 0)); // <-- is zero
image.image(0, 0, 160, 90, mask.data());
this won't change the mask at all because the alpha value is 0.
If I change it to
let Wallpaper { mut image, data } = wallpaper;
let mut mask = Image::from_color(160, 90, Color::rgb(255, 255, 255));
mask.rounded_rect(2, 2, 156, 86, 5, true, Color::rgba(0, 0, 0, 1)); // <-- now is one
image.image(0, 0, 160, 90, mask.data());
the rounded_rectangle
call won't get ignored, but then image
won't interpolate it with previous values on the image, which results in a slightly dark rounded rectangle instead of a white border around the wallpaper preview.
http://i.imgur.com/u7SaTDm.png
Alpha value handling should be made the same across all renderer functions, or not to slow down existing applications that don't require correct alpha handling, a new AlphaRenderer
implementation
should be made.