summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorscuri <scuri>2009-10-23 19:01:28 +0000
committerscuri <scuri>2009-10-23 19:01:28 +0000
commit999918c4962de2ae2bf1acaab2f5f50024a259e1 (patch)
treeb4e40d8a1197efd64456ee67db189a039746d409 /src
parent5753ae89d5266a664a6468ce7df31ef0d8a6ae2a (diff)
Fixed: CanvasText for WD when using text with multiple lines.
Diffstat (limited to 'src')
-rw-r--r--src/cd_text.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/cd_text.c b/src/cd_text.c
index 4b3e839..2568e25 100644
--- a/src/cd_text.c
+++ b/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++)