From 7edfb2f6dc2f899aed519e880c798b828dc7041a Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Fri, 24 Jul 2009 13:56:22 -0500 Subject: [PATCH] gdiplus: don't use -escapement angle in GdipDrawString In GdipDrawString, we calculate -escapement, get its sine and cosine, then negate that value when creating the LOGFONT. However, the linebreak code assumes we have the sine and cosine of escapement, not -escapement. This fixes linebreaks in rotated text. --- dlls/gdiplus/graphics.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 58ca2e6..dcff926 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2328,10 +2328,10 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string pt[1].X = 1.0; pt[1].Y = 0.0; GdipTransformMatrixPoints(graphics->worldtrans, pt, 2); - angle = gdiplus_atan2((pt[1].Y - pt[0].Y), (pt[1].X - pt[0].X)); + angle = -gdiplus_atan2((pt[1].Y - pt[0].Y), (pt[1].X - pt[0].X)); ang_cos = cos(angle); ang_sin = sin(angle); - lfw.lfEscapement = lfw.lfOrientation = -roundr((angle / M_PI) * 1800.0); + lfw.lfEscapement = lfw.lfOrientation = roundr((angle / M_PI) * 1800.0); gdifont = CreateFontIndirectW(&lfw); DeleteObject(SelectObject(graphics->hdc, CreateFontIndirectW(&lfw))); -- 1.5.4.3