Cleanup: fix translation for rare UV unwrapping with unit scale

Fixes very rare cases where the UV Cylinder Project, UV Sphere Project
and UV From View might not set the translation correctly if the scale
is exactly 1.0.

Mainly fixed because this code might later be reused elsewhere.
This commit is contained in:
Chris Blackbourn
2022-11-01 12:50:16 +13:00
parent 5016a8687c
commit c3e4fa7404

View File

@@ -1774,8 +1774,8 @@ static void uv_map_clip_correct(const Scene *scene,
dy = 1.0f / dy;
}
if (dx == 1.0f && dy == 1.0f) {
/* Scaling by 1.0 has no effect. */
if (dx == 1.0f && dy == 1.0f && min[0] == 0.0f && min[1] == 0.0f) {
/* Scaling by 1.0, without translating, has no effect. */
return;
}