From fd8c1af15476649a5619d7685f185bf395629baf Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 16 Feb 2022 20:50:01 +0100 Subject: [PATCH] Get the dimensions from the texture instead of the image in texture_get_uv_rect of the material cache. This fixes the uv mapping for the character on the web backend. --- material_cache/ess_material_cache_pcm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/material_cache/ess_material_cache_pcm.cpp b/material_cache/ess_material_cache_pcm.cpp index 4641436..a8b73d7 100644 --- a/material_cache/ess_material_cache_pcm.cpp +++ b/material_cache/ess_material_cache_pcm.cpp @@ -93,8 +93,8 @@ Rect2 ESSMaterialCachePCM::texture_get_uv_rect(const Ref &texture) { return Rect2(0, 0, 1, 1); } - float w = image->get_width(); - float h = image->get_height(); + float w = tex->get_width(); + float h = tex->get_height(); region.position = Size2(region.position.x / w, region.position.y / h); region.size = Size2(region.size.x / w, region.size.y / h);