diff --git a/win32ss/user/rtl/text.c b/win32ss/user/rtl/text.c index 7670e2e595..9f52d3c941 100644 --- a/win32ss/user/rtl/text.c +++ b/win32ss/user/rtl/text.c @@ -1262,27 +1262,26 @@ INT WINAPI DrawTextExWorker( HDC hdc, if (flags & DT_SINGLELINE) { + if (flags & DT_VCENTER) #ifdef __REACTOS__ - if (flags & DT_VCENTER) - { - if (flags & DT_CALCRECT) - { - if (rect->bottom - rect->top < size.cy / 2) - y = rect->top + (invert_y ? size.cy : -size.cy) / 2; - } - else { - y = rect->top + (rect->bottom - rect->top + (invert_y ? size.cy : -size.cy)) / 2; - } - } - else if (flags & DT_BOTTOM) - y = rect->bottom + (invert_y ? 0 : -size.cy); + if (((rect->bottom - rect->top) < (invert_y ? -size.cy : size.cy)) && (flags & DT_CALCRECT)) + { + y = rect->top + (invert_y ? -size.cy : size.cy); + } + else + { + y = rect->top + (rect->bottom - rect->top + (invert_y ? size.cy : -size.cy)) / 2; #else - if (flags & DT_VCENTER) y = rect->top + - (rect->bottom - rect->top) / 2 - size.cy / 2; - else if (flags & DT_BOTTOM) y = rect->bottom - size.cy; + y = rect->top + (rect->bottom - rect->top) / 2 + (invert_y ? (size.cy / 2) : (-size.cy / 2)); #endif - } +#ifdef __REACTOS__ + } + } +#endif + else if (flags & DT_BOTTOM) + y = rect->bottom + (invert_y ? 0 : -size.cy); + } if (!(flags & DT_CALCRECT)) {