summaryrefslogtreecommitdiff
path: root/cd/src/cd_text.c
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2010-06-15 00:18:43 -0700
committerPixel <pixel@nobis-crew.org>2010-06-15 00:18:43 -0700
commit25e85e1b809ec58ecac0f2e8fe48f74836f8e131 (patch)
treea53caef2257fefdd6610a17427fd14ee656bbc92 /cd/src/cd_text.c
parent7c0c85a86aa73c0c495523f994f8412e377a8195 (diff)
Upgrading to CD 5.3
Diffstat (limited to 'cd/src/cd_text.c')
-rwxr-xr-xcd/src/cd_text.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/cd/src/cd_text.c b/cd/src/cd_text.c
index 4b3e839..2568e25 100755
--- a/cd/src/cd_text.c
+++ b/cd/src/cd_text.c
@@ -166,6 +166,23 @@ void cdfCanvasText(cdCanvas* canvas, double x, double y, const char *s)
else /* CD_CENTER || CD_EAST || CD_WEST */ /* it is relative to the full text */
cdfMovePoint(&x, &y, 0, (num_line-1)*line_height/2.0, sin_theta, cos_theta);
}
+ else
+ {
+ int align = canvas->text_alignment;
+
+ /* position vertically at the first line */
+ if (align == CD_NORTH || align == CD_NORTH_EAST || align == CD_NORTH_WEST || /* it is relative to the full text */
+ align == CD_BASE_LEFT || align == CD_BASE_CENTER || align == CD_BASE_RIGHT) /* it is relative to the first line already */
+ {
+ /* Already at position */
+ }
+ else if (align == CD_SOUTH || align == CD_SOUTH_EAST || align == CD_SOUTH_WEST) /* it is relative to the full text */
+ {
+ y += (num_line-1)*line_height;
+ }
+ else /* CD_CENTER || CD_EAST || CD_WEST */ /* it is relative to the full text */
+ y += ((num_line-1)*line_height)/2.0;
+ }
p = s;
for(i = 0; i < num_line; i++)