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

This commit is contained in:
Alex Szpakowski
2013-09-19 23:33:13 -03:00
parent 0ce0db9e1b
commit b5c231e5bb
6 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -44,8 +44,8 @@ WindowFlags::WindowFlags()
, vsync(true)
, fsaa(0)
, resizable(false)
, minwidth(0)
, minheight(0)
, minwidth(1)
, minheight(1)
, borderless(false)
, centered(true)
, display(0)
+2 -2
View File
@@ -125,8 +125,8 @@ struct WindowFlags
bool vsync; // = true
int fsaa; // = 0
bool resizable; // = false
int minwidth; // = 0
int minheight; // = 0
int minwidth; // = 1
int minheight; // = 1
bool borderless; // = false
bool centered; // = true
int display; // = 0
+2 -2
View File
@@ -85,8 +85,8 @@ bool Window::setWindow(int width, int height, WindowFlags *flags)
if (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());
+2 -2
View File
@@ -68,8 +68,8 @@ int w_setMode(lua_State *L)
flags.vsync = luax_boolflag(L, 3, "vsync", true);
flags.fsaa = luax_intflag(L, 3, "fsaa", 0);
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.centered = luax_boolflag(L, 3, "centered", true);
flags.display = luax_intflag(L, 3, "display", 1);