summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixFont.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2020-04-21 06:57:35 (GMT)
committerfvogel <fvogelnew1@free.fr>2020-04-21 06:57:35 (GMT)
commit5ed4790f7555c57fa47e3467c819aa111c632978 (patch)
tree0f2c2cfb671f204b1b6e8d3d2ab8b137394528c3 /unix/tkUnixFont.c
parent981e941cbfec9cdea31b3bde6666e9a5afc6ea85 (diff)
downloadtk-5ed4790f7555c57fa47e3467c819aa111c632978.zip
tk-5ed4790f7555c57fa47e3467c819aa111c632978.tar.gz
tk-5ed4790f7555c57fa47e3467c819aa111c632978.tar.bz2
Apply a third patch from Christopher Chavez.
Diffstat (limited to 'unix/tkUnixFont.c')
-rw-r--r--unix/tkUnixFont.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index a1b969e..c91da55 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -1413,7 +1413,6 @@ TkpDrawCharsInContext(
rangeLength, x+widthUntilStart, y);
}
-/* UNTESTED */
void
TkpDrawAngledCharsInContext(
Display *display, /* Display on which to draw. */
@@ -1437,12 +1436,13 @@ TkpDrawAngledCharsInContext(
double angle) /* What angle to put text at, in degrees. */
{
int widthUntilStart;
+ double sinA = sin(angle * PI/180.0), cosA = cos(angle * PI/180.0);
(void) numBytes; /*unused*/
Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
TkDrawAngledChars(display, drawable, gc, tkfont, source + rangeStart,
- rangeLength, x+widthUntilStart, y, angle);
+ rangeLength, x+cosA*widthUntilStart, y-sinA*widthUntilStart, angle);
}
/*