From ac25f124858b79e302adcc533d6a658d5c529394 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Fri, 1 Jun 2012 22:16:37 +0200 Subject: Return correct bounding box of glyphs on Linux, we forgot to rotate it. This makes the behavior consistent with what happens on Windows. Change-Id: Ifb04d4a8e485182c5ef2771025b06832bfd75ae0 --- vcl/unx/generic/gdi/salgdi3.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'vcl/unx') diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index 7761445a89b6..04d21427872c 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -701,7 +701,21 @@ sal_Bool X11SalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& nGlyphIndex &= GF_IDXMASK; const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex ); - rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() ); + Rectangle aRect( rGM.GetOffset(), rGM.GetSize() ); + + if ( pSF->mnCos != 0x10000 && pSF->mnSin != 0 ) + { + double nCos = pSF->mnCos / 65536.0; + double nSin = pSF->mnSin / 65536.0; + rRect.Left() = nCos*aRect.Left() + nSin*aRect.Top(); + rRect.Top() = -nSin*aRect.Left() - nCos*aRect.Top(); + + rRect.Right() = nCos*aRect.Right() + nSin*aRect.Bottom(); + rRect.Bottom() = -nSin*aRect.Right() - nCos*aRect.Bottom(); + } + else + rRect = aRect; + return sal_True; } -- cgit v1.2.3