mirror of
https://github.com/Relintai/props.git
synced 2024-11-12 10:15:25 +01:00
Get the dimensions from the texture instead of the image in texture_get_uv_rect of the material cache. This fixes some of the uv related issues on the webgl backend.
This commit is contained in:
parent
401666b560
commit
165048ded4
@ -93,8 +93,8 @@ Rect2 PropMaterialCachePCM::texture_get_uv_rect(const Ref<Texture> &texture) {
|
|||||||
return Rect2(0, 0, 1, 1);
|
return Rect2(0, 0, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
float w = image->get_width();
|
float w = tex->get_width();
|
||||||
float h = image->get_height();
|
float h = tex->get_height();
|
||||||
|
|
||||||
region.position = Size2(region.position.x / w, region.position.y / h);
|
region.position = Size2(region.position.x / w, region.position.y / h);
|
||||||
region.size = Size2(region.size.x / w, region.size.y / h);
|
region.size = Size2(region.size.x / w, region.size.y / h);
|
||||||
|
Loading…
Reference in New Issue
Block a user