summaryrefslogtreecommitdiff
path: root/alf/alflabel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alf/alflabel.cpp')
-rw-r--r--alf/alflabel.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/alf/alflabel.cpp b/alf/alflabel.cpp
index 87d5baa..6f01cce 100644
--- a/alf/alflabel.cpp
+++ b/alf/alflabel.cpp
@@ -162,16 +162,19 @@ ALF_Label_CalculateSize(HWND hwnd, ALFLabelPriv *priv, SIZE *pSize)
ALF_Free(textbuf);
- if (pSize->cx == 0) {
- pSize->cx = r.right - r.left;
- if ((priv->style & ALF_LABEL_HALIGN_MASK) == ALF_LABEL_ALIGN_LEFT_LIKE_EDIT)
- pSize->cx += ALF__LabelLeftPadding(hwnd, hdcLabel, priv);
- }
- if (pSize->cy == 0) {
- pSize->cy = r.bottom - r.top;
- if ((priv->style & ALF_LABEL_VALIGN_MASK) == ALF_LABEL_ALIGN_TOP_LIKE_EDIT)
- pSize->cy += ALF__LabelTopPadding(hwnd, priv);
- }
+ int cx = r.right - r.left;
+ if ((priv->style & ALF_LABEL_HALIGN_MASK) == ALF_LABEL_ALIGN_LEFT_LIKE_EDIT)
+ cx += ALF__LabelLeftPadding(hwnd, hdcLabel, priv);
+
+ int cy = r.bottom - r.top;
+ if ((priv->style & ALF_LABEL_VALIGN_MASK) == ALF_LABEL_ALIGN_TOP_LIKE_EDIT)
+ cy += ALF__LabelTopPadding(hwnd, priv);
+
+
+ if (pSize->cx < cx)
+ pSize->cx = cx;
+ if (pSize->cy < cy)
+ pSize->cy = cy;
SelectFont(hdcLabel, oldFont);