summaryrefslogtreecommitdiff
path: root/alf/alfgroupbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alf/alfgroupbox.cpp')
-rw-r--r--alf/alfgroupbox.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/alf/alfgroupbox.cpp b/alf/alfgroupbox.cpp
index 9786323..5c459dc 100644
--- a/alf/alfgroupbox.cpp
+++ b/alf/alfgroupbox.cpp
@@ -62,6 +62,15 @@ ALF_GroupBox_PaintFrameUxtheme(ALFGroupBoxPriv *priv, HWND hwnd, HDC dc, RECT *r
RECT rc;
GetClientRect(hwnd, &rc);
+ // Skip drawing the border if that is not requested, since stretching that bitmap might be expensive.
+ // Will happen when a transparent child calls DrawThemeParentBackground.
+ RECT rcTop = { 0, 0, rc.right-rc.left, priv->layout.containerMargins.top };
+ RECT rcLeft = { 0, 0, priv->layout.containerMargins.left, rc.bottom-rc.top };
+ RECT rcRight = { rc.right-rc.left-priv->layout.containerMargins.right, 0, rc.right-rc.left, rc.bottom-rc.top };
+ RECT rcBottom = { 0, rc.bottom-rc.top-priv->layout.containerMargins.bottom, rc.right-rc.left, rc.bottom-rc.top };
+ if (!RectVisible(dc, &rcTop) && !RectVisible(dc, &rcLeft) && !RectVisible(dc, &rcRight) && !RectVisible(dc, &rcBottom))
+ return;
+
rc.top += priv->calculatedLabelSize.cy / 2;
HRGN oldClipR = CreateRectRgn(0, 0, 0, 0);