fix atlas wrong size calculation

This commit is contained in:
Moritz Zwerger 2023-10-07 22:46:42 +02:00
parent ab1882019a
commit 0701df836f
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ class RawAtlasElement(
fun load(textures: AtlasTextureManager): AtlasElement {
val (texture, uvStart, uvEnd) = textures.add(texture, assets, start, end, resolution)
val size = (end + 1) - start
val size = end - start
return AtlasElement(texture, uvStart, uvEnd, size, slots, areas)

View File

@ -40,7 +40,7 @@ class AtlasTextureManager(private val context: RenderContext) {
val realStart = start * scale
val realEnd = end * scale
val size = (realEnd + 1) - realStart
val size = realEnd - realStart
val target = request(size)