From 87e20ccafb66c0c32038cd4874f464dde8dba03f Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 5 Jul 2015 10:06:24 -0300 Subject: [PATCH] Fixed the display index parameter of love.window.getFullscreenModes, getDesktopDimensions, and setPosition to be 1-based instead of 0-based (resolves issue #1056.) --- src/modules/window/wrap_Window.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/window/wrap_Window.cpp b/src/modules/window/wrap_Window.cpp index 914062399..9d8595ec3 100644 --- a/src/modules/window/wrap_Window.cpp +++ b/src/modules/window/wrap_Window.cpp @@ -194,7 +194,7 @@ int w_getFullscreenModes(lua_State *L) { int displayindex = 0; if (!lua_isnoneornil(L, 1)) - displayindex = (int) luaL_checknumber(L, 1); + displayindex = (int) luaL_checknumber(L, 1) - 1; else { int x, y; @@ -271,7 +271,7 @@ int w_getDesktopDimensions(lua_State *L) int width = 0, height = 0; int displayindex = 0; if (!lua_isnoneornil(L, 1)) - displayindex = (int) luaL_checknumber(L, 1); + displayindex = (int) luaL_checknumber(L, 1) - 1; else { int x, y; @@ -290,7 +290,7 @@ int w_setPosition(lua_State *L) int displayindex = 0; if (!lua_isnoneornil(L, 3)) - displayindex = (int) luaL_checknumber(L, 3); + displayindex = (int) luaL_checknumber(L, 3) - 1; else { int x_unused, y_unused;