From 67948705f4640b647e26a66a2c95c3229af17c9f Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Tue, 8 Oct 2013 20:15:36 +0300 Subject: [PATCH] Gfx: Improve D2D compatibility with GDI+ with zero height text when calculating lines --- Common/Gfx/CanvasD2D.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Common/Gfx/CanvasD2D.cpp b/Common/Gfx/CanvasD2D.cpp index 1ab02e86..f4fac908 100644 --- a/Common/Gfx/CanvasD2D.cpp +++ b/Common/Gfx/CanvasD2D.cpp @@ -410,6 +410,11 @@ bool CanvasD2D::MeasureTextLinesW(const WCHAR* str, UINT strLen, const TextForma // bottom. This is a workaround to emulate that behaviour. rect.Height += 1.0f; } + else + { + // GDI+ compatibility: Zero height text has no visible lines. + lines = 0; + } return true; }