mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-27 19:25:36 +00:00
[WIN32SS][COMCTL32] Improve button text position (#2135)
Improve DrawText function especially DT_CALCRECT and DT_VCENTER. CORE-15478
This commit is contained in:
+2
-12
@@ -1263,18 +1263,8 @@ INT WINAPI DrawTextExWorker( HDC hdc,
|
|||||||
if (flags & DT_SINGLELINE)
|
if (flags & DT_SINGLELINE)
|
||||||
{
|
{
|
||||||
#ifdef __REACTOS__
|
#ifdef __REACTOS__
|
||||||
if (flags & DT_VCENTER)
|
if (flags & DT_VCENTER) y = rect->top +
|
||||||
{
|
(rect->bottom - rect->top + (invert_y ? size.cy : -size.cy)) / 2;
|
||||||
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)
|
else if (flags & DT_BOTTOM)
|
||||||
y = rect->bottom + (invert_y ? 0 : -size.cy);
|
y = rect->bottom + (invert_y ? 0 : -size.cy);
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user