shithub: orca

Download patch

ref: 0d142196bfcd02ebfd4a1c86ff2f58b39e988437
parent: f25050b42d29be132d12707330a9527203d616e4
author: cancel <cancel@cancel.fm>
date: Thu Jan 2 20:58:17 EST 2020

Add incremental margin collapse for grid<->HUD

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