wlt: terminal: remove dead non-snap code
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sun, 30 Sep 2012 21:51:34 +0000 (23:51 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Sun, 30 Sep 2012 21:51:34 +0000 (23:51 +0200)
This code isn't needed at all. It doesn't make sense to disable snapping
so remove this dead code.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/wlt_terminal.c

index 44f3950..8493ff5 100644 (file)
@@ -205,37 +205,28 @@ static void widget_prepare_resize(struct wlt_widget *widget,
                                  unsigned int *new_height,
                                  void *data)
 {
-       static const bool do_snap = true;
        struct wlt_terminal *term = data;
        unsigned int w, h;
 
-       /* TODO: allow disabling this via command-line */
-       if (do_snap) {
-               if (*new_width >= width) {
-                       *new_width += term->font_normal->attr.width;
-               } else {
-                       w = width - *new_width;
-                       w /= term->font_normal->attr.width;
-                       if (!w)
-                               w = 1;
-                       w *= term->font_normal->attr.width;
-                       *new_width += w;
-               }
-               if (*new_height >= height) {
-                       *new_height += term->font_normal->attr.height;
-               } else {
-                       h = height - *new_height;
-                       h /= term->font_normal->attr.height;
-                       if (!h)
-                               h = 1;
-                       h *= term->font_normal->attr.height;
-                       *new_height += h;
-               }
+       if (*new_width >= width) {
+               *new_width += term->font_normal->attr.width;
+       } else {
+               w = width - *new_width;
+               w /= term->font_normal->attr.width;
+               if (!w)
+                       w = 1;
+               w *= term->font_normal->attr.width;
+               *new_width += w;
+       }
+       if (*new_height >= height) {
+               *new_height += term->font_normal->attr.height;
        } else {
-               if (*new_width < width)
-                       *new_width = width;
-               if (*new_height < height)
-                       *new_height = height;
+               h = height - *new_height;
+               h /= term->font_normal->attr.height;
+               if (!h)
+                       h = 1;
+               h *= term->font_normal->attr.height;
+               *new_height += h;
        }
 }