# HG changeset patch # User John Tsiombikas # Date 1315183410 -10800 # Node ID f416d8def7ef6d1ba39b7fbf3c5122d011b1eb12 # Parent 4c2b3e281409e7124d901cb5b898e9cd5b3556dc can't remember diff -r 4c2b3e281409 -r f416d8def7ef src/layout.c --- a/src/layout.c Sat May 28 22:31:51 2011 +0300 +++ b/src/layout.c Mon Sep 05 03:43:30 2011 +0300 @@ -1,4 +1,5 @@ #include +#include #include "imtk.h" struct layout { @@ -31,15 +32,16 @@ return -1; } top--; + return 0; } -void imtk_layout_start(int x, int y, int sp, int dir) +void imtk_layout_start(int x, int y) { st[top].box[0] = st[top].span[0] = x; st[top].box[1] = st[top].span[1] = y; st[top].box[2] = st[top].box[3] = st[top].span[2] = st[top].span[3] = 0; - st[top].spacing = sp; - st[top].dir = dir; +/* st[top].spacing = sp; + st[top].dir = dir;*/ } void imtk_layout_dir(int dir) @@ -50,6 +52,11 @@ } } +void imtk_layout_spacing(int spacing) +{ + st[top].spacing = spacing; +} + void imtk_layout_advance(int width, int height) { int max_span_y, max_box_y; @@ -78,7 +85,7 @@ void imtk_layout_newline(void) { st[top].span[0] = st[top].box[0]; - st[top].span[1] = st[top].box[1] + st[top].box[3] + spacing; + st[top].span[1] = st[top].box[1] + st[top].box[3] + st[top].spacing; st[top].span[2] = st[top].span[3] = 0; } diff -r 4c2b3e281409 -r f416d8def7ef test.c --- a/test.c Sat May 28 22:31:51 2011 +0300 +++ b/test.c Mon Sep 05 03:43:30 2011 +0300 @@ -125,7 +125,9 @@ char *itemlist; imtk_begin(); - imtk_layout_start(30, 50, 10, IMTK_VERTICAL); + imtk_layout_start(30, 50); + imtk_layout_spacing(10); + imtk_layout_dir(IMTK_VERTICAL); /*glBegin(GL_QUADS); glColor3f(0.6, 0.6, 0.6);