ui/ncurses: Warn if widget runs over horizontal pad width
authorSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Fri, 3 Oct 2014 04:37:20 +0000 (14:37 +1000)
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Wed, 8 Oct 2014 03:36:00 +0000 (14:36 +1100)
Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com>
ui/ncurses/nc-widgets.c

index 5592db9c7769a3c68fc03497776f469d208d0abc..f82192939dd968d1dfd4ce2f889cbb382b1d6d8b 100644 (file)
@@ -877,6 +877,10 @@ void widget_move(struct nc_widget *widget, int y, int x)
 
        widget->x = x;
        widget->y = y;
 
        widget->x = x;
        widget->y = y;
+
+       if (x + widget->width > COLS)
+               pb_debug("%s: Widget at %d,%d runs over pad! (%d)", __func__,
+                      y, x, x + widget->width);
 }
 
 int widget_height(struct nc_widget *widget)
 }
 
 int widget_height(struct nc_widget *widget)