mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
@@ -13,6 +13,7 @@ local ReaderDogear = InputContainer:new{}
|
||||
function ReaderDogear:init()
|
||||
local widget = ImageWidget:new{
|
||||
file = "resources/icons/dogear.png",
|
||||
alpha = true,
|
||||
}
|
||||
self[1] = RightContainer:new{
|
||||
dimen = Geom:new{w = Screen:getWidth(), h = widget:getSize().h},
|
||||
|
||||
@@ -37,6 +37,8 @@ local ImageWidget = Widget:new{
|
||||
height = nil,
|
||||
-- if autoscale is true image will be rescaled according to screen dpi
|
||||
autoscale = false,
|
||||
-- when alpha is set to true, alpha values from the image will be honored
|
||||
alpha = false,
|
||||
_bb = nil
|
||||
}
|
||||
|
||||
@@ -108,7 +110,11 @@ function ImageWidget:paintTo(bb, x, y)
|
||||
w = size.w,
|
||||
h = size.h
|
||||
}
|
||||
bb:blitFrom(self._bb, x, y, 0, 0, size.w, size.h)
|
||||
if self.alpha == true then
|
||||
bb:alphablitFrom(self._bb, x, y, 0, 0, size.w, size.h)
|
||||
else
|
||||
bb:blitFrom(self._bb, x, y, 0, 0, size.w, size.h)
|
||||
end
|
||||
if self.invert then
|
||||
bb:invertRect(x, y, size.w, size.h)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user