MLEM icon indicating copy to clipboard operation
MLEM copied to clipboard

Image offsets by TextureRegion's pivot in an undesired way

Open all-iver opened this issue 1 year ago • 1 comments

When using MLEM's Image, if your TextureRegion has its pivot somewhere other than the top left of the texture region, this causes Image to draw with the texture's pivot at the top left of the UI rect. That makes it hard to reuse the same TextureRegion with a sprite that wants the pivot to be at an arbitrary area.

all-iver avatar Mar 07 '25 18:03 all-iver

Note to self: we talked on the discord about the version of TextureRegionExtensions.Draw that takes in a Rectangle, and the fact that it seems to also use the pivot as a position offset there. I'm starting to think that maybe that doesn't actually make a lot of sense, and, when specifying the destination rectangle specifically, it should ignore the pivot for positioning outright.

Ellpeck avatar Mar 07 '25 18:03 Ellpeck