From 03637a75c1bebf8b35b520139b9ddfa3238ee53f Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 14 Mar 2016 07:29:14 +0200 Subject: Fix what seems to have been off-by-one errors in glyph bounds calculation For some reason the error had a visible impact (as far as I an see, anyway) only for Graphite fonts. The bottommost pixels were cut off. (Also leftmost, but that was not so easily visible.) Rectangle type, I love you. Change-Id: I6f7438ec21d2bc1b9bef31cd70e649856f7ec7d5 --- vcl/win/gdi/salfont.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index a47f3d1bd0da..3278e888ecf2 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -2014,9 +2014,9 @@ bool WinSalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) rRect = Rectangle( Point( +aGM.gmptGlyphOrigin.x, -aGM.gmptGlyphOrigin.y ), Size( aGM.gmBlackBoxX, aGM.gmBlackBoxY ) ); rRect.Left() = static_cast( mfCurrentFontScale * rRect.Left() ); - rRect.Right() = static_cast( mfCurrentFontScale * rRect.Right() ); + rRect.Right() = static_cast( mfCurrentFontScale * rRect.Right() ) + 1; rRect.Top() = static_cast( mfCurrentFontScale * rRect.Top() ); - rRect.Bottom() = static_cast( mfCurrentFontScale * rRect.Bottom() ); + rRect.Bottom() = static_cast( mfCurrentFontScale * rRect.Bottom() ) + 1; return true; } -- cgit v1.2.3