shithub: orca

Download patch

ref: 82eaa84506a3e1ee3569d53ba7786cfc8d352b25
parent: 6da6312908aba92f3aafe86cbe9e527cca45ae51
author: cancel <cancel@cancel.fm>
date: Thu Jan 2 22:45:25 EST 2020

Fix bias in grid/hud spacing during margins collapse

--- a/tui_main.c
+++ b/tui_main.c
@@ -1245,9 +1245,9 @@
   int win_h = a->win_h;
   int softmargin_y = a->softmargin_y;
   bool show_hud = win_h > Hud_height + 1;
-  int grid_h = show_hud ? win_h - 2 : win_h;
+  int grid_h = show_hud ? win_h - Hud_height : win_h;
   if (grid_h > a->field.height) {
-    int halfy = (grid_h - a->field.height) / 2;
+    int halfy = (grid_h - a->field.height + 1) / 2;
     grid_h -= halfy < softmargin_y ? halfy : softmargin_y;
   }
   a->grid_h = grid_h;