user32: Right text placement (Bugfix for #22109)

Alexandre Julliard julliard at winehq.org
Wed Sep 8 12:10:31 CDT 2010


Wolfgang Schwotzer <wolfgang.schwotzer at gmx.net> writes:

> Much thanks to Konstantin Kondratyuk. He is the brain behind this bugfix.
>
> --- a/dlls/user32/text.c	2010-06-01 18:14:04.000000000 +0200
> +++ b/dlls/user32/text.c	2010-06-01 18:15:37.000000000 +0200
> @@ -954,8 +954,12 @@
>  
>  	if (flags & DT_SINGLELINE)
>  	{
> -	    if (flags & DT_VCENTER) y = rect->top +
> -	    	(rect->bottom - rect->top) / 2 - size.cy / 2;
> +	    if (flags & DT_VCENTER)
> +	    {
> +		int sign = 1;
> +		if (rect->top < 0 && rect->bottom < 0) sign = -1;
> +		y = rect->top + (rect->bottom - rect->top) / 2 - sign * size.cy / 2;

This doesn't make sense, the sign should depend on the viewport
mappings, not on the position being negative.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list