diff src/menu.cc @ 80:2f1ecc1c5f72

Huge cleanup -- move some global variables into a struct.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 26 Sep 2011 17:39:49 +0300
parents a68786b9c74b
children 4580d53cefff
line wrap: on
line diff
--- a/src/menu.cc	Mon Sep 26 17:14:54 2011 +0300
+++ b/src/menu.cc	Mon Sep 26 17:39:49 2011 +0300
@@ -704,15 +704,15 @@
         + items.back().y + item_height;
 
     if (user_ox0 < 0)
-        ox0 = (ScrMaxX - width) / 2;
+        ox0 = (cfg.ScrMaxX - width) / 2;
     else
         ox0 = user_ox0;
     ix0 = ox0 + BOX_BORDER;
     ix1 = ix0 + 2 * WIDE_HSPACING + width_chars * FONTW - 1;
     ox1 = ix1 + BOX_BORDER;
-    if (ox1 > ScrMaxX)
+    if (ox1 > cfg.ScrMaxX)
     {
-        int overlap = ox1 - ScrMaxX;
+        int overlap = ox1 - cfg.ScrMaxX;
         ox0 -= overlap;
         ix0 -= overlap;
         ix1 -= overlap;
@@ -720,7 +720,7 @@
     }
 
     if (user_oy0 < 0)
-        oy0 = (ScrMaxY - height) / 2;
+        oy0 = (cfg.ScrMaxY - height) / 2;
     else
         oy0 = user_oy0;
     iy0 = oy0 + BOX_BORDER;