r_restart on conwidth/conheight change to reload fonts at the proper sizes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / slider_resolution.c
index 0c33e34..a7cf04b 100644 (file)
@@ -61,8 +61,16 @@ void updateConwidths(float width, float height, float pixelheight)
                f = 1;
        c = c * f; // fteqcc fail
 
-       cvar_set("vid_conwidth", ftos(rint(c_x)));
-       cvar_set("vid_conheight", ftos(rint(c_y)));
+       c_x = rint(c_x);
+       c_y = rint(c_y);
+
+       if (c_x != cvar("vid_conwidth") || c_y != cvar("vid_conheight"))
+       {
+               cvar_set("vid_conwidth", ftos(c_x));
+               cvar_set("vid_conheight", ftos(c_y));
+               localcmd("\nr_restart\n");
+       }
+
        XonoticResolutionSlider_DataHasChanged = TRUE;
 }
 entity makeXonoticResolutionSlider()