[mtl canvas] Fix nTilesX/nTilesY computation in oc_mtl_canvas_render (don't multiply twice by scale)

This commit is contained in:
Martin Fouilleul 2023-08-29 18:13:01 +02:00
parent 9164e66cc6
commit 07414af087
1 changed files with 2 additions and 2 deletions

View File

@ -1204,8 +1204,8 @@ void oc_mtl_canvas_render(oc_canvas_backend* interface,
f32 scale = surface->mtlLayer.contentsScale;
oc_vec2 viewportSize = { frameSize.x * scale, frameSize.y * scale };
int tileSize = OC_MTL_TILE_SIZE;
int nTilesX = (int)(viewportSize.x * scale + tileSize - 1) / tileSize;
int nTilesY = (int)(viewportSize.y * scale + tileSize - 1) / tileSize;
int nTilesX = (int)(viewportSize.x + tileSize - 1) / tileSize;
int nTilesY = (int)(viewportSize.y + tileSize - 1) / tileSize;
if(viewportSize.x != backend->frameSize.x || viewportSize.y != backend->frameSize.y)
{