]> git.mdlowis.com Git - projs/tide.git/commitdiff
start adding logic to build the rows
authorMichael D. Lowis <mike@mdlowis.com>
Wed, 18 Apr 2018 00:36:08 +0000 (20:36 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Wed, 18 Apr 2018 00:36:08 +0000 (20:36 -0400)
lib/view.c

index cc9d10dc58db04b35478de16870cbfab5fe94bbb..33825b340ba9bc9bf5d551996d1a63b47b04a0a3 100644 (file)
@@ -84,6 +84,15 @@ size_t view_limitrows(View* view, size_t maxrows, size_t ncols) {
 }
 
 void view_resize(View* view, size_t width, size_t nrows) {
+    /* free up the old data */
+    if (view->rows) {
+        for (size_t i = 0; i < view->nrows; i++)
+            free(view->rows[i]);
+        free(view->rows);
+        view->nrows = 0;
+    }
+    /* start from beginning of first line and populate row by row */
+
 }
 
 void view_update(View* view, size_t* csrx, size_t* csry) {