Bug when wrapping print with centering and scaling

I’ve noticed a few issues when using Canvas->WrappedPrint() while using centering and scaling. First of all, if you center on Y, it ends up printing every line at the same y, so you get a whole bunch of overlapped strings.

Secondly, if you center on x and then pass in scaling, it will scale the text, but it won’t take into account scaling when calculating the line length used when centering. For example, if the line is 100 pixels wide and your centered position is at (50,50) at scale 1.0, it will print the string starting at (50 - (100/2), 50) = (0,50). If you then try to scale the whole hud to 50% to fit a smaller screen, so the text takes up half the width, it will still use 200 pixels as the string length. This will give (50scale - (100/2), 50scale) = (-25, 25), with the string starting off the screen, while the actual drawn length of the string will be properly scaled and only take up 50 pixels.

Thank you for your report.

I have assigned this issue to a member of our support staff, and they will begin investigation as soon as possible. If we are unable to reproduce the issue, or we need additional information, our staff member will comment here with additional questions. Otherwise, we will post an ‘Answer’ once we have logged the issue in our bug database or we have a solution for it.

In the meantime, please be sure to review our suggestions for how to report a bug, and feel free to edit your post if you have additional information to provide.

Thank you.

Hi ,

Are you creating this HUD in C++ or blueprints?

Hi ,

We have not heard from you in quite some time. I am marking this question as answered for tracking purposes. If you are still experiencing this problem, please comment with the information requested.

Sorry for the long time delay, for some reason I wasn’t getting notifications for posting.
This was all in C++.

Hi ,

Thank you for bringing this to our attention. I have put in a report about the issue that you described, and a developer is looking into it. We apologize for any inconvenience this may be causing.

Fixed by the following change. Will be in 4.5.

https://github.com/EpicGames/UnrealEngine/commit/0276c16c18698a86754fa15a8161ea0220b4de76
https://github.com/EpicGames/UnrealEngine/commit/2858651ed8b2b6db82a415e437eab38093553085