Browse Source

The window minwidth and minheight can't be less than 1

Alex Szpakowski 12 years ago
parent
commit
b5c231e5bb

+ 2 - 2
src/modules/window/Window.cpp

@@ -44,8 +44,8 @@ WindowFlags::WindowFlags()
 	, vsync(true)
 	, vsync(true)
 	, fsaa(0)
 	, fsaa(0)
 	, resizable(false)
 	, resizable(false)
-	, minwidth(0)
-	, minheight(0)
+	, minwidth(1)
+	, minheight(1)
 	, borderless(false)
 	, borderless(false)
 	, centered(true)
 	, centered(true)
 	, display(0)
 	, display(0)

+ 2 - 2
src/modules/window/Window.h

@@ -125,8 +125,8 @@ struct WindowFlags
 	bool vsync; // = true
 	bool vsync; // = true
 	int fsaa; // = 0
 	int fsaa; // = 0
 	bool resizable; // = false
 	bool resizable; // = false
-	int minwidth; // = 0
-	int minheight; // = 0
+	int minwidth; // = 1
+	int minheight; // = 1
 	bool borderless; // = false
 	bool borderless; // = false
 	bool centered; // = true
 	bool centered; // = true
 	int display; // = 0
 	int display; // = 0

+ 2 - 2
src/modules/window/sdl/Window.cpp

@@ -85,8 +85,8 @@ bool Window::setWindow(int width, int height, WindowFlags *flags)
 	if (flags)
 	if (flags)
 		f = *flags;
 		f = *flags;
 
 
-	f.minwidth = std::max(f.minwidth, 0);
-	f.minheight = std::max(f.minheight, 0);
+	f.minwidth = std::max(f.minwidth, 1);
+	f.minheight = std::max(f.minheight, 1);
 
 
 	f.display = std::min(std::max(f.display, 0), getDisplayCount());
 	f.display = std::min(std::max(f.display, 0), getDisplayCount());
 
 

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

@@ -68,8 +68,8 @@ int w_setMode(lua_State *L)
 	flags.vsync = luax_boolflag(L, 3, "vsync", true);
 	flags.vsync = luax_boolflag(L, 3, "vsync", true);
 	flags.fsaa = luax_intflag(L, 3, "fsaa", 0);
 	flags.fsaa = luax_intflag(L, 3, "fsaa", 0);
 	flags.resizable = luax_boolflag(L, 3, "resizable", false);
 	flags.resizable = luax_boolflag(L, 3, "resizable", false);
-	flags.minwidth = luax_intflag(L, 3, "minwidth", 0);
-	flags.minheight = luax_intflag(L, 3, "minheight", 0);
+	flags.minwidth = luax_intflag(L, 3, "minwidth", 1);
+	flags.minheight = luax_intflag(L, 3, "minheight", 1);
 	flags.borderless = luax_boolflag(L, 3, "borderless", false);
 	flags.borderless = luax_boolflag(L, 3, "borderless", false);
 	flags.centered = luax_boolflag(L, 3, "centered", true);
 	flags.centered = luax_boolflag(L, 3, "centered", true);
 	flags.display = luax_intflag(L, 3, "display", 1);
 	flags.display = luax_intflag(L, 3, "display", 1);

+ 2 - 2
src/scripts/boot.lua

@@ -283,8 +283,8 @@ function love.init()
 		window = {
 		window = {
 			width = 800,
 			width = 800,
 			height = 600,
 			height = 600,
-			minwidth = 0,
-			minheight = 0,
+			minwidth = 1,
+			minheight = 1,
 			fullscreen = false,
 			fullscreen = false,
 			fullscreentype = "normal",
 			fullscreentype = "normal",
 			display = 1,
 			display = 1,

+ 2 - 2
src/scripts/boot.lua.h

@@ -511,8 +511,8 @@ const unsigned char boot_lua[] =
 	0x09, 0x09, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x7b, 0x0a,
 	0x09, 0x09, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x7b, 0x0a,
 	0x09, 0x09, 0x09, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x3d, 0x20, 0x38, 0x30, 0x30, 0x2c, 0x0a,
 	0x09, 0x09, 0x09, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x3d, 0x20, 0x38, 0x30, 0x30, 0x2c, 0x0a,
 	0x09, 0x09, 0x09, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x3d, 0x20, 0x36, 0x30, 0x30, 0x2c, 0x0a,
 	0x09, 0x09, 0x09, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x3d, 0x20, 0x36, 0x30, 0x30, 0x2c, 0x0a,
-	0x09, 0x09, 0x09, 0x6d, 0x69, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x0a,
-	0x09, 0x09, 0x09, 0x6d, 0x69, 0x6e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x0a,
+	0x09, 0x09, 0x09, 0x6d, 0x69, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x3d, 0x20, 0x31, 0x2c, 0x0a,
+	0x09, 0x09, 0x09, 0x6d, 0x69, 0x6e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x3d, 0x20, 0x31, 0x2c, 0x0a,
 	0x09, 0x09, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x3d, 0x20, 0x66, 0x61, 
 	0x09, 0x09, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x3d, 0x20, 0x66, 0x61, 
 	0x6c, 0x73, 0x65, 0x2c, 0x0a,
 	0x6c, 0x73, 0x65, 0x2c, 0x0a,
 	0x09, 0x09, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x20, 
 	0x09, 0x09, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x74, 0x79, 0x70, 0x65, 0x20,