Absolute position taking my actual screen resolution instead of imagelabel size

bit stumped as i am currently writing a path tracer, but ive run across an issue where absolute position takes from my actual screen size instead of the size of said image label

this is the code for calculating it


ik my math function colours are weird, but its because im storing them in a separate module script which is called with “math” so it doesnt have to create the math function every time i call it. its just there which is a small micro optimisation as far as i can tell

the red dots in this image are what its currently rendering, and the green dots are what it should be rendering

1 Like

Do you use UIRatioConstraint?
That could be it.

i do use aspect ratio contraint. but its not had an issue until recently which is why im confused

it most likely straight up lies to you with absolute size (not sure)?
If you want similar alghoritm to the one that roblox uses to calculate UIAspectRatio: UIStrokes Scaling made simple

it turns out it aint the constraint. its absoluteposition and absolutesize themselves having the issue


you can see that, even without the constraint, its still rendering from the top left, right where the gui inset ends

its rendering specifically this part of the screen (just the top left corner, at seemingly double the size of the image itself)

nvm, ik why it was. i was using the editableimages own coordinates for the origin instead of the actual screen position of the image

this is the resolved code
image

nvm yet again. still got the issue, but it is closer to what i want

Intended behavior, absolute position is the absolute position, can you clarify what you’re trying to do exactly?
Are you trying to put some UI object at a screen point? If so, you’ll need to calculate the relative position.

This would probably make it slower, actually.
math is a built-in global shared table, and it does not create new closures or function objects every call.