Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NinePatch does not work correctly with arbitrary Texture2DRegion patches #943

Closed
Dwergi opened this issue Sep 2, 2024 · 0 comments · Fixed by #945
Closed

NinePatch does not work correctly with arbitrary Texture2DRegion patches #943

Dwergi opened this issue Sep 2, 2024 · 0 comments · Fixed by #945

Comments

@Dwergi
Copy link
Contributor

Dwergi commented Sep 2, 2024

If the Mid region is offset from the top-left of the image by more than the top and left sides of the patch, for example by using middle images from a spritesheet, then the Padding calculation will be wrong, and will instead take the position of the Mid region within the spritesheet as being the padding from the top-left.

I'll submit a PR to fix this in a bit.

Dwergi added a commit to Dwergi/MonoGame.Extended that referenced this issue Sep 2, 2024
AristurtleDev added a commit that referenced this issue Sep 30, 2024
* fix(Matrix3x2): decompose method (#941)

* Fix bug when using `NinePatch` with `Texture2DRegion`. (#945)

Resolves #943

* BitmapFont now always loads from TitleContainer. (#946)

Fixes KNI web builds when using BitmapFont (#944)

* Fix bug when creating a NinePatch using the Texture2DRegion extension method (#948)

* Revert UV code (#951)

* [Weekly] Version 4.0.3 (#952)

* Starting 4.0.2 release prep

* Update changelog

* Bump version number to 4.0.3

* Updated workflows to use dotnet 8

---------

Co-authored-by: Ilia Bahrebar <150489740+Std-Enigma@users.noreply.github.com>
Co-authored-by: Dwergi <sebastian.nordgren@gmail.com>
Co-authored-by: Joseph Newman <greenstack@users.noreply.github.com>
Co-authored-by: Jeremy Swartwood <jeremy.swartwood@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant