home · contact · privacy
Only allow movement rightwards if pad is big enough.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 6 Jun 2013 10:10:30 +0000 (12:10 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 6 Jun 2013 10:10:30 +0000 (12:10 +0200)
windows.c

index cf64b4e11fb0da2db2271929fde9b3de51f2466c..775f32478df04f3a2f98a26c35d425aa96d177a4 100644 (file)
--- a/windows.c
+++ b/windows.c
@@ -18,8 +18,8 @@ struct WinMeta init_win_meta (WINDOW * screen) {
   return win_meta; }
 
 void scroll_pad (struct WinMeta * win_meta, char dir) {
-// Scroll pad left (if possible) or right.
-  if      ('+' == dir)
+// Scroll pad left or right (if possible).
+  if      ('+' == dir && win_meta->pad_offset + win_meta->width < getmaxx(win_meta->pad))
     win_meta->pad_offset++;
   else if ('-' == dir && win_meta->pad_offset > 0)
     win_meta->pad_offset--; }