ID:2199924
 
Resolved
Maptext on a transformed object sometimes caused that object to appear in the wrong position, depending on maptext size and offsets.
BYOND Version:511.1369
Operating System:N/A
Web Browser:N/A
Applies to:Dream Seeker
Status: Resolved (511.1370)

This issue has been resolved.
Code:
//too much code affected here; will post snippets if requested...


Problem description:
So I just updated to the latest byond beta, and blew the dust off of my latest project and compiled it, and I run it... and then I find that half of my maptext is now misaligned.
There's too much code here to specifically show, so I'm just going to show screenshots and describe how stuff is constructed and aligned in my gui.

This is how it looked before (on version 511.1349). This is how it should look.
https://puu.sh/tapaf/fc09ea1469.webm

This is how it looks now on version 511.1367



Most of the gui text here is built with nested overlays with concatenated transforms.

These looked pretty good on the older version of BYOND, but they are misaligned to hell on the newest version of BYOND in a seemingly random manner.


Here's a crude tree diagram that illustrates the way I have the GUI in this setup.


I designed this with the assumption that things that an overlay appearance's transform is concatenated with it's parent object's transform.

So right now, I do the traditional method of adding text shadows/outlines, where you have copies of the text that are offset and on a lower layer. Outlines require four copies, and shadows require one copy.
These are offset via atom.transform, because some of the text needs to be animated; if the text were not animated, then I would probably just add it as a GUI child (which simply has a offset screen_loc).

Note that the white text for the character's name is not misaligned, but the portions of it that make up the black outline are terribly misaligned. The white text simply has a screen_loc equal to it's parent's screen_loc + some x and y offset. It is not an overlay and does not have a transform. But the black outline texts are overlays of the white text; the 4 pieces have transforms (translation of 1 pixel in each cardinal direction).

Since the tooltips (or the description boxes) are animated, so everything that goes inside of the tooltip should be an overlay. This way, if I animate() the tooltip, all of the stuff that goes inside of the tooltip is also animated along with it. This is why outlines are made up of overlays with transforms; I wanted them to be easy to use with animate().

However, just about every maptext object that has a is an overlay is incredibly misaligned, even though it used to be aligned perfectly on previous versions of BYOND. I can't tell if the misalignment has to do with the transform or not. I'm assuming that something changed with how the engine treats overlays with transforms or maybe how the engine treats overlays with maptext?

How should I fix the new misalignment? I haven't been able to come up with anything because although every maptext overlay is VERY misaligned, they seem to be misaligned in an almost random manner. I can't determine a concrete model for the behavior.
Fun fact: the title object text in the screenshots above with "Flimsy Sheath" and "Smoke Bomb" use the same function to generate the outline overlays, but the outline overlays are misaligned in a different manner! This makes me want to pull my hair out.

[EDIT]: the text alignment is correct if I downgrade to version 511.1349
At some point, atom.transform started affecting maptext.

This was an intended change.

It screwed with some of my things too, such as my screenbox demo. There was also a change to how same-layer objects are layered in client.screen that broke Hazordhu's character creation HUD. That was easier to fix.
I have the same issue with the maptext system i'm using too lol. I haven't got to fixing it though
In response to Kaiochao
I would think so but that was implemented in 510.1324, and I've confirmed that the alignment is correct in 511.1349
I could swear I was told something about maptext having issues but I can't find the bug report on it. Maybe it was in a pager message, but if so I've lost track. Can you send me a demo and some info on what I should be looking for?
I got your demo and I see the problem. I'm gonna have to figure out the math all over on this.
Lummox JR resolved issue with message:
Maptext on a transformed object sometimes caused that object to appear in the wrong position, depending on maptext size and offsets.