user32: Use InflateRect() too when stretching the RECT in just one axis.
Michael Stefaniuc
mstefani at redhat.de
Mon Jul 4 02:47:27 CDT 2016
Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
---
With the inline version of InflateRect() this produces the exact same
edit.o file when using CFLAGS=-O2 -g0.
dlls/user32/edit.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c
index 179d44a..23139e9 100644
--- a/dlls/user32/edit.c
+++ b/dlls/user32/edit.c
@@ -2376,14 +2376,9 @@ static void EDIT_SetRectNP(EDITSTATE *es, const RECT *rc)
else if (es->style & WS_BORDER) {
bw = GetSystemMetrics(SM_CXBORDER) + 1;
bh = GetSystemMetrics(SM_CYBORDER) + 1;
- es->format_rect.left += bw;
- es->format_rect.right -= bw;
- if (es->format_rect.bottom - es->format_rect.top
- >= es->line_height + 2 * bh)
- {
- es->format_rect.top += bh;
- es->format_rect.bottom -= bh;
- }
+ InflateRect(&es->format_rect, -bw, 0);
+ if (es->format_rect.bottom - es->format_rect.top >= es->line_height + 2 * bh)
+ InflateRect(&es->format_rect, 0, -bh);
}
es->format_rect.left += es->left_margin;
--
2.4.11
More information about the wine-patches
mailing list