summaryrefslogtreecommitdiff
path: root/alf/alflabel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alf/alflabel.cpp')
-rw-r--r--alf/alflabel.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/alf/alflabel.cpp b/alf/alflabel.cpp
index 59c92fa..f424486 100644
--- a/alf/alflabel.cpp
+++ b/alf/alflabel.cpp
@@ -203,6 +203,19 @@ ALF__LabelWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
ReleaseDC(hwnd, hdcLabel);
}
+ } else if (uMsg == WM_WINDOWPOSCHANGED) {
+ WINDOWPOS *p = (WINDOWPOS *)lParam;
+ if (!(p->flags & SWP_NOSIZE)) {
+ // for left-top aligned labels, no redraw is necessary
+ // right/bottom/center alignment basically needs to redraw the whole thing
+ DWORD halign = priv->style & ALF_LABEL_HALIGN_MASK;
+ DWORD valign = priv->style & ALF_LABEL_VALIGN_MASK;
+
+ if ((halign != ALF_LABEL_ALIGN_LEFT && halign != ALF_LABEL_ALIGN_LEFT_LIKE_EDIT)
+ || (valign != ALF_LABEL_ALIGN_TOP && valign != ALF_LABEL_ALIGN_TOP_LIKE_EDIT)) {
+ InvalidateRect(hwnd, NULL, TRUE);
+ }
+ }
} else if (uMsg == WM_DESTROY) {
ALF_Free(priv);
SetWindowLongPtr(hwnd, 0, 0);