summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Kümmerlin <jonas@kuemmerlin.eu>2020-05-01 18:35:13 +0200
committerJonas Kümmerlin <jonas@kuemmerlin.eu>2020-05-01 18:35:13 +0200
commit3e069b70cf30a69ea2a3f71233b8f258f54284bc (patch)
tree7f4f0e86f4c1e56d2802fa5dbc6b4699cd2204c8
parent5a3b46ee43fc601121a85d910d044033d891748f (diff)
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.
-rw-r--r--alf/alfbutton.cpp6
1 files changed, 3 insertions, 3 deletions
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;