allow emulator to specify a viewport

This allows for Viewport debugging. It is configured via an environment
variable, EMULATE_READER_VIEWPORT. It works with Lua table syntax, e.g.:
EMULATE_READER_VIEWPORT="{x=10,w=550,y=5,h=790}"
pull/1269/head
Hans-Werner Hilse 10 years ago
parent bf7ea7af6d
commit 677871cbf7

@ -13,6 +13,13 @@ local Device = Generic:new{
}
function Device:init()
-- allows to set a viewport via environment variable
-- syntax is Lua table syntax, e.g. EMULATE_READER_VIEWPORT="{x=10,w=550,y=5,h=790}"
local viewport = os.getenv("EMULATE_READER_VIEWPORT")
if viewport then
self.viewport = require("ui/geometry"):new(loadstring("return " .. viewport)())
end
if util.haveSDL2() then
self.screen = require("ffi/framebuffer_SDL2_0"):new{device = self}
self.input = require("device/input"):new{

Loading…
Cancel
Save