Browse Source

Fixed the display index parameter of love.window.getFullscreenModes, getDesktopDimensions, and setPosition to be 1-based instead of 0-based (resolves issue #1056.)

Alex Szpakowski 10 years ago
parent
commit
87e20ccafb
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/modules/window/wrap_Window.cpp

+ 3 - 3
src/modules/window/wrap_Window.cpp

@@ -194,7 +194,7 @@ int w_getFullscreenModes(lua_State *L)
 {
 {
 	int displayindex = 0;
 	int displayindex = 0;
 	if (!lua_isnoneornil(L, 1))
 	if (!lua_isnoneornil(L, 1))
-		displayindex = (int) luaL_checknumber(L, 1);
+		displayindex = (int) luaL_checknumber(L, 1) - 1;
 	else
 	else
 	{
 	{
 		int x, y;
 		int x, y;
@@ -271,7 +271,7 @@ int w_getDesktopDimensions(lua_State *L)
 	int width = 0, height = 0;
 	int width = 0, height = 0;
 	int displayindex = 0;
 	int displayindex = 0;
 	if (!lua_isnoneornil(L, 1))
 	if (!lua_isnoneornil(L, 1))
-		displayindex = (int) luaL_checknumber(L, 1);
+		displayindex = (int) luaL_checknumber(L, 1) - 1;
 	else
 	else
 	{
 	{
 		int x, y;
 		int x, y;
@@ -290,7 +290,7 @@ int w_setPosition(lua_State *L)
 
 
 	int displayindex = 0;
 	int displayindex = 0;
 	if (!lua_isnoneornil(L, 3))
 	if (!lua_isnoneornil(L, 3))
-		displayindex = (int) luaL_checknumber(L, 3);
+		displayindex = (int) luaL_checknumber(L, 3) - 1;
 	else
 	else
 	{
 	{
 		int x_unused, y_unused;
 		int x_unused, y_unused;