From 3e069b70cf30a69ea2a3f71233b8f258f54284bc Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Fri, 1 May 2020 18:35:13 +0200 Subject: button: don't clip text Especially on WinXP, subpixel colors from ClearType may bleed beyond the bounding rectangle, and it looks better when they're visible. I highly suspect that the underlying issue is actually a bug in XP, since ClearType stays within bounds on Win7 and newer. --- alf/alfbutton.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'alf') diff --git a/alf/alfbutton.cpp b/alf/alfbutton.cpp index 6721dc7..6b0974b 100644 --- a/alf/alfbutton.cpp +++ b/alf/alfbutton.cpp @@ -259,7 +259,7 @@ ALF_NtButton_RenderUxtheme(HWND hwnd, ALFNtButtonPriv *priv, int uxstate, DWORD if ((drawFlags & ALF_NTBTN_FLAG_IS_FOCUSED) && !(drawFlags & ALF_NTBTN_FLAG_HIDEFOCUS)) DrawFocusRect(hDC, &content); - UINT style = DT_CENTER; + UINT style = DT_CENTER | DT_NOCLIP; if (drawFlags & ALF_NTBTN_FLAG_HIDEACCEL) style |= DT_HIDEPREFIX; @@ -323,7 +323,7 @@ ALF_NtButton_RenderClassic(HWND hwnd, ALFNtButtonPriv *priv, HDC dc, RECT *rcPai texttarget.bottom += 1; } - UINT style = DT_CENTER; + UINT style = DT_CENTER | DT_NOCLIP; if (priv->drawFlags & ALF_NTBTN_FLAG_HIDEACCEL) style |= DT_HIDEPREFIX; @@ -779,7 +779,7 @@ ALF_ClassicButton_Paint(HWND hwnd, ALFClassicButtonPriv *priv, DRAWITEMSTRUCT *d DrawFrameControl(dis->hDC, &r, DFC_BUTTON, dfcs); RECT textbounds = r; - DrawText(dis->hDC, textbuf, -1, &textbounds, DT_LEFT | DT_CALCRECT); + DrawText(dis->hDC, textbuf, -1, &textbounds, DT_LEFT | DT_CALCRECT | DT_NOCLIP); textbounds.bottom++; // this appears to be the secret for correct vertical centering RECT texttarget = r; -- cgit v1.2.3