draw: support top and bottom as align

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-11-04 15:48:18 +01:00
parent 0b6b96131a
commit 24a8e6d377
2 changed files with 7 additions and 1 deletions

4
draw.c
View File

@ -877,6 +877,8 @@ draw_align_fromstr(const char *align, ssize_t len)
case A_TK_CENTER: return AlignCenter;
case A_TK_RIGHT: return AlignRight;
case A_TK_FLEX: return AlignFlex;
case A_TK_TOP: return AlignTop;
case A_TK_BOTTOM: return AlignBottom;
default: return AlignLeft;
}
}
@ -894,6 +896,8 @@ draw_align_tostr(alignment_t a)
case AlignCenter: return "center";
case AlignRight: return "right";
case AlignFlex: return "flex";
case AlignBottom: return "bottom";
case AlignTop: return "top";
default: return NULL;
}
}

4
draw.h
View File

@ -48,7 +48,9 @@ typedef enum
AlignLeft = (0),
AlignRight = (1),
AlignCenter = (1 << 1),
AlignFlex = (1 << 2),
AlignTop = (1 << 2),
AlignBottom = (1 << 3),
AlignFlex = (1 << 4),
} alignment_t;
typedef struct vector_t vector_t;