bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46556: 27.1; transparent images are displayed incorrectly if rotated


From: Eli Zaretskii
Subject: bug#46556: 27.1; transparent images are displayed incorrectly if rotated
Date: Wed, 17 Feb 2021 22:26:36 +0200

> Date: Wed, 17 Feb 2021 20:07:27 +0000
> From: Alan Third <alan@idiocy.org>
> 
> In fact, I'm just looking over w32term.c and in the function transform
> there are two equations:
> 
>   pt.x =
>     x0 + (x - x0) * xform->eM11 + (y - y0) * xform->eM21 + xform->eDx + 0.5f;
>   pt.y =
>     y0 + (x - x0) * xform->eM12 + (y - y0) * xform->eM22 + xform->eDy + 0.5f;
> 
> What happens if you remove the +0.5f from them? I'm guessing they're
> there to influence the rounding during conversion from a floating
> point calculation into an integer?

Yes.  Removing them produces worse results.

Anyway, as I said earlier, I stepped through the code, and all the
vertices are computed without any roundoff, exactly as expected.
Moreover, the "good" squares, which have no 1-pixel problem, come out
of that code with exactly the same values as the "bad" one, modulo the
shift in X direction.  The members of xform matrix are also exact,
either zero or +/-1.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]