mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Implement proper alpha-blending of SVG icons (#7011)
* Implement proper alpha-blending of SVG icons Also, instead of doing that every time, cache a pre-composited version that matches the screen's BB type. This is faster, and also has the advantage of making icon highlights behave. Jot down a few notes about corner-cases or future improvements, e.g., dimming icons on non-white backgrounds, and nightmode with color icons.
This commit is contained in:
@@ -35,7 +35,7 @@ local IconWidget = ImageWidget:extend{
|
||||
-- be overriden by callers.
|
||||
width = Screen:scaleBySize(DGENERIC_ICON_SIZE), -- our icons are square
|
||||
height = Screen:scaleBySize(DGENERIC_ICON_SIZE),
|
||||
alpha = true, -- our icons have a transparent background
|
||||
alpha = false, --- @note: our icons have a transparent background, but we flatten them at caching time, and this flag is only checked at blitting time.
|
||||
is_icon = true, -- avoid dithering in ImageWidget:paintTo()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user