RenderIcon() incorectly included extra HUD tiles in its size calculations.
BYOND Version:515.1602
Operating System:Windows 10 Enterprise
Web Browser:Chrome
Applies to:Dream Seeker
Status: Resolved (515.1603)

This issue has been resolved.
Descriptive Problem Summary:
When trying to use rendericon to get proper icon to render near message in browser, their image got squished, so i decided to check what resolution icon is being rendered in, and it turned out to be wrong resolution. Then i decided to run the same snippet in project unrelated to mine, and it did exactly the same thing. Am i using it wrong or there's something wrong going on?
Will provide with additional information requested to resolve this, Thank you.

Trying out same code in two different projects 1087047953564323910/image.png 1087047953774035106/image.png

Code Snippet (if applicable) to Reproduce Problem:
fps = 20 // 25 frames per second
icon_size = 32 // 32x32 icon size by default
view = 7 // show up to 6 tiles outward from center (15x15 view)


var/icon/I = icon(client.RenderIcon(object))
world << "[I.Width()]"
world << "[I.Height()]"
src << "\icon[I] Thats a []"

Expected Results:
Icon with 32x32 size

Actual Results:
Icon with 128x32 size

Does the problem occur:
Tested it on three separate projects, always had same result

When does the problem NOT occur?
Couldn't make it work proper

Using old method of icon display in css
Created new project from scratch, this doesn't seem to occur in clean project, what could cause this in existing projects?
I have figured out way to replicate this issue.
Turns out, having any elements rendering outside of client view (anything that has screen loc that is less than 1) starts to give additional pixels icons that are made with RenderIcon()

Object has screen_loc of -2 leads to rendericon size of 128x32: 1087070565052993546/image.png 1087070599026839613/image.png

Removed any icons outside of client viewport leads to render icon output to have 32x32 icon size 1087070708435275836/image.png 1087070658967650404/image.png
BYOND has fallen
I'm gonna need a test project so I can reproduce this and investigate.

I also need you to edit your report to include the full BYOND version you're using.
In response to Lummox JR 1087102135444963338/Bug_Testing_Grounds.rar, just press test continously and it will increase rendericon size

If not comfortable with downloading files:
icon = 'icons/mob/human.dmi'
var/offset = 0
var/tests = list()

var/icon/I = icon(client.RenderIcon(src))
world << "RenderIcon width is now [I.Width()]"
world << "RenderIcon height is now [I.Height()]"
src << "\icon[I] Thats a []"

world << "press test button again"

var/obj/test/T = new(src)
T.screen_loc = "[offset],1"
tests += T
for(var/obj/O in tests)
client.screen += O


icon = 'icons/mob/human.dmi'
icon_state = "test"
Lummox JR resolved issue with message:
RenderIcon() incorectly included extra HUD tiles in its size calculations.