mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Misc: Use the ^ operator instead of math.pow (#9550)
And some minor code simplifications, thanks to @zwim ;).
This commit is contained in:
@@ -33,7 +33,7 @@ local logger = require("logger")
|
||||
local function get_dpi_scale()
|
||||
local size_scale = math.min(Screen:getWidth(), Screen:getHeight()) / 600
|
||||
local dpi_scale = Screen:scaleByDPI(1)
|
||||
return math.pow(2, math.max(0, math.log((size_scale+dpi_scale)/2)/0.69))
|
||||
return math.max(0, (math.log((size_scale+dpi_scale)/2)/0.69)^2)
|
||||
end
|
||||
local DPI_SCALE = get_dpi_scale()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user