[Bug]: Child sprites with zero offset and identical size to their parent can be misaligned from their parent #12289
Labels
needs triage
This issue needs further investigation before it becomes actionable
Version of OpenTTD
14.0-RC1
Expected result
A child sprite with zero offset and an identical size to the parent sprite (I'm using the example of station roofs and the transparency effect sprite) should be exactly aligned with their parent at all zoom levels.
Actual result
Misalignment can occur. I'm not sure what causes this issue, but I've seen it at 4x zoom.
For this example, the roof sprite (in nml) is:
[ 196*z+x*z, 66*z+y*z, 64*z, 64*z+z-1, -31*z, -16*z-int((z-1)/2)-1, NOCROP]
The child sprite with the darken/transparency effect recolour is:
[ 261*z+x*z, 66*z+y*z, 64*z, 64*z+z-1, 0, 0, NOCROP]
Here, x and y are the position within the sprite sheet and z is the zoom.
Both are
(w, h) = (64*z, 64*z+z-1)
. The child sprite has offsets(xoffs, yoffs) = (0, 0)
.The child sprite is drawn 2px too high.
Steps to reproduce
stationbug.zip
The text was updated successfully, but these errors were encountered: