Skip to content

Commit

Permalink
fix incorrect merge with master from #843 (#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
Frenzie committed Apr 22, 2019
1 parent 5be7118 commit 5b9620b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions ffi/framebuffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ function fb:scaleBySize(px)
-- if users custom screen dpi, also scale by dpi
local dpi_scale = size_scale

local custom_dpi = EMULATE_READER_DPI or screen_dpi_override
if custom_dpi and self.device and self.device.display_dpi ~= self.dpi then
if self.device and self.device.display_dpi ~= self.dpi then
dpi_scale = self.dpi / 160
end
-- scaled positive px should also be positive
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/framebuffer_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ describe("Framebuffer unit tests", function()

it("should scale by DPI", function()
fb:setDPI(167)
assert.are.equals(30, fb:scaleBySize(30))
assert.are.equals(31, fb:scaleBySize(30))

fb:setDPI(167 * 3)
assert.are.equals(60, fb:scaleBySize(30))
assert.are.equals(62, fb:scaleBySize(30))
end)
end)

0 comments on commit 5b9620b

Please sign in to comment.