godotengine / godotengine/godot

`AtlasTexture` margin size.x/y has no effect if corresponding region size.x/y is zero

Open
#102,473 0 comments 0 reactions 0 assignees View on GitHub
discussion topic:gui
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

4.4 beta 2

### System information

Windows 10

### Issue description

Docs say:
> If either dimension of the region's size is 0, the value from atlas size will be used for that axis instead

But it does not work well with margins as issue title says:

| One axis is zero | Both axises are zero |
| --- | --- |
| ![Image](https://github.com/user-attachments/assets/8b524ea9-a330-4efe-8b86-68d188a087a6) | ![Image](https://github.com/user-attachments/assets/346e1ac0-0dbd-4d63-96b2-0512d9070407) |

Discovered during https://github.com/godotengine/godot/pull/102467

This behaviour may be confusing. Worth to fix in code or document it.

### Steps to reproduce

Add archive content from "MRP" to project, set region size to (0, 0), try to change margin size.

### Minimal reproduction project (MRP)

[atlas_texture_bugged.zip](https://github.com/user-attachments/files/18683785/atlas_texture_bugged.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.