Skip to content
Permalink
Browse files

Pourquoi faire simple quand on peut faire compliqué ;p.

Simpler icon test, following @poire-z's suggestion ;).
  • Loading branch information...
NiLuJe committed Apr 14, 2019
1 parent f12869e commit 431bcd47aa8fac1a0b66de4e9a4c147430596182
Showing with 6 additions and 6 deletions.
  1. +6 −6 frontend/ui/widget/imagewidget.lua
@@ -357,26 +357,26 @@ function ImageWidget:paintTo(bb, x, y)
}
logger.dbg("blitFrom", x, y, self._offset_x, self._offset_y, size.w, size.h)
-- Figure out if we're trying to render one of our own icons...
local not_an_icon = (not self.file or (self.file and not util.stringStartsWith(self.file, "resources/")))
local is_icon = self.file and util.stringStartsWith(self.file, "resources/")
if self.alpha == true then
-- Only actually try to alpha-blend if the image really has an alpha channel...
local bbtype = self._bb:getType()
if bbtype == Blitbuffer.TYPE_BB8A or bbtype == Blitbuffer.TYPE_BBRGB32 then
-- NOTE: MuPDF feeds us premultiplied alpha (and we don't care w/ GifLib, as alpha is all or nothing).
if Screen.sw_dithering and not_an_icon then
if Screen.sw_dithering and not is_icon then
bb:ditherpmulalphablitFrom(self._bb, x, y, self._offset_x, self._offset_y, size.w, size.h)
else
bb:pmulalphablitFrom(self._bb, x, y, self._offset_x, self._offset_y, size.w, size.h)
end
else
if Screen.sw_dithering and not_an_icon then
if Screen.sw_dithering and not is_icon then
bb:ditherblitFrom(self._bb, x, y, self._offset_x, self._offset_y, size.w, size.h)
else
bb:blitFrom(self._bb, x, y, self._offset_x, self._offset_y, size.w, size.h)
end
end
else
if Screen.sw_dithering and not_an_icon then
if Screen.sw_dithering and not is_icon then
bb:ditherblitFrom(self._bb, x, y, self._offset_x, self._offset_y, size.w, size.h)
else
bb:blitFrom(self._bb, x, y, self._offset_x, self._offset_y, size.w, size.h)
@@ -390,9 +390,9 @@ function ImageWidget:paintTo(bb, x, y)
end
-- If in night mode, invert all rendered images, so the original is
-- displayed when the whole screen is inverted by night mode.
-- Except for our black & white icon files, that we want inverted
-- Except for our black & white icon files, that we do want inverted
-- in night mode.
if Screen.night_mode and not_an_icon then
if Screen.night_mode and not is_icon then
bb:invertRect(x, y, size.w, size.h)
end
end

1 comment on commit 431bcd4

@Frenzie

This comment has been minimized.

Copy link
Member

commented on 431bcd4 Apr 14, 2019

Parce que c'est chouette !

Please sign in to comment.
You can’t perform that action at this time.