GNU bug report logs -
#46556
27.1; transparent images are displayed incorrectly if rotated
Previous Next
Full log
Message #28 received at 46556 <at> debbugs.gnu.org (full text, mbox):
> Date: Wed, 17 Feb 2021 20:07:27 +0000
> From: Alan Third <alan <at> 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.
This bug report was last modified 3 years and 95 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.