bugfix: keep Viewport dimensions more up to date
Scenario: 1. I connect to carousel.love 2. I try to press C-n, nothing seems to happen 3. I quit and restart and get this cryptic error: SDL error: window too large "width": 19103, "height": 9849.984375 I can manually edit config to adjust width and height and restart driver.love. I don't really understand all the details of how this comes about. While investigating this, however, I noticed one thing: in step 2 the new node is indeed being spawned, it's just happening out of viewport because Viewport dimensions are much larger than the window. Once I started looking for it, I noticed this stale information in many apps. Let's see if keeping viewport dimensions up to date causes the scenario above to stop occurring.
This commit is contained in:
parent
f038fa1bcc
commit
c3df57ce61
|
@ -9,6 +9,9 @@ on.initialize = function()
|
|||
Settings[App_name].definitions = get_default_map()
|
||||
end
|
||||
Viewport = Settings[App_name].viewport
|
||||
-- We might have resized the window since the last time we connected to this app, so don't trust viewport dimensions
|
||||
Viewport.w = App.screen.width
|
||||
Viewport.h = App.screen.height
|
||||
Definitions = Settings[App_name].definitions
|
||||
local names = {}
|
||||
for name, _ in pairs(Definitions) do
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
on.resize = function(w, h)
|
||||
Viewport.w = w
|
||||
Viewort.h = h
|
||||
end
|
Loading…
Reference in New Issue