From 73f7d860cdee63fec75bb8b3b8a7c8d6f5ff8a62 Mon Sep 17 00:00:00 2001 From: frankyifei Date: Wed, 20 Apr 2016 01:16:27 +0930 Subject: [PATCH] imagewidget fix bring back the old behavior: when width and height are set and all the zooming options are false, zoom the image to that size. The last commit to Imagewidget.lua caused it ignores the set width and height and use the image's original size instead when no zoom option is set. This caused #1979. Although #1979 can be fixed by setting autostretch=true, but I think it's good to fix here. --- frontend/ui/widget/imagewidget.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/ui/widget/imagewidget.lua b/frontend/ui/widget/imagewidget.lua index d17511d46..9ed5540dd 100644 --- a/frontend/ui/widget/imagewidget.lua +++ b/frontend/ui/widget/imagewidget.lua @@ -87,7 +87,7 @@ function ImageWidget:_render() error("cannot render image") end local native_w, native_h = self._bb:getWidth(), self._bb:getHeight() - local w, h + local w, h = self.width, self.height if self.autoscale then local dpi_scale = Screen:getDPI() / 167 -- rounding off to power of 2 to avoid alias with pow(2, floor(log(x)/log(2))