mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[WIN32SS] Fix DrawText wrt DT_CALCRECT | DT_VCENTER (#745)
The test program: https://jira.reactos.org/secure/attachment/47925/TnB3.zip CORE-14896
This commit is contained in:
parent
68a4cdd5ec
commit
11b7619a71
1 changed files with 17 additions and 16 deletions
|
@ -1148,26 +1148,27 @@ INT WINAPI DrawTextExWorker( HDC hdc,
|
||||||
|
|
||||||
if (flags & DT_SINGLELINE)
|
if (flags & DT_SINGLELINE)
|
||||||
{
|
{
|
||||||
if (flags & DT_VCENTER)
|
|
||||||
#ifdef __REACTOS__
|
#ifdef __REACTOS__
|
||||||
|
if (flags & DT_VCENTER)
|
||||||
|
{
|
||||||
|
if (flags & DT_CALCRECT)
|
||||||
{
|
{
|
||||||
if (((rect->bottom - rect->top) < (invert_y ? -size.cy : size.cy)) && (flags & DT_CALCRECT))
|
if (rect->bottom - rect->top < size.cy / 2)
|
||||||
{
|
y = rect->top + (invert_y ? size.cy : -size.cy) / 2;
|
||||||
y = rect->top + (invert_y ? -size.cy : size.cy);
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
y = rect->top + (rect->bottom - rect->top + (invert_y ? size.cy : -size.cy)) / 2;
|
||||||
y = rect->top + (rect->bottom - rect->top + (invert_y ? size.cy : -size.cy)) / 2;
|
|
||||||
#else
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
else if (flags & DT_BOTTOM)
|
||||||
|
y = rect->bottom + (invert_y ? 0 : -size.cy);
|
||||||
|
#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;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if (!(flags & DT_CALCRECT))
|
if (!(flags & DT_CALCRECT))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue