mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-10 03:13:28 +00:00
better font api
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@229 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
10
src/draw.c
10
src/draw.c
@@ -359,13 +359,19 @@ void MwDrawTriangle(MwWidget handle, MwRect* rect, MwLLColor color, int invert,
|
||||
MwLLFreeColor(darker);
|
||||
}
|
||||
|
||||
void MwDrawText(MwWidget handle, MwPoint* point, const char* text, int bold, MwLLColor color) {
|
||||
void MwDrawText(MwWidget handle, MwPoint* point, const char* text, int bold, int align, MwLLColor color) {
|
||||
int i, x, y, sx, sy;
|
||||
MwRect r;
|
||||
|
||||
sx = point->x - strlen(text) * FontWidth * FontScale / 2;
|
||||
sx = point->x;
|
||||
sy = point->y - FontHeight * FontScale / 2;
|
||||
|
||||
if(align == MwALIGNMENT_CENTER) {
|
||||
sx -= strlen(text) * FontWidth * FontScale / 2;
|
||||
} else if(align == MwALIGNMENT_END) {
|
||||
sx -= strlen(text) * FontWidth * FontScale;
|
||||
}
|
||||
|
||||
for(i = 0; text[i] != 0; i++) {
|
||||
for(y = 0; y < FontHeight; y++) {
|
||||
for(x = 0; x < FontWidth; x++) {
|
||||
|
||||
Reference in New Issue
Block a user