diff options
author | matc <matc> | 2019-07-29 07:26:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-07-29 07:28:02 +0300 |
commit | a542f50b51af0167acc55d4cf2b06490a704ce93 (patch) | |
tree | f955582efbc6a59bca9fe34a49e46a2cb4292a13 /source/blender/bmesh/operators | |
parent | a49838ccb0f647aa5eab84a4858591f6231283ad (diff) |
Fix T67523: Incorrect UV's for grid primitive
Diffstat (limited to 'source/blender/bmesh/operators')
-rw-r--r-- | source/blender/bmesh/operators/bmo_primitive.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c index cf3d6b8bf56..2eedefe7980 100644 --- a/source/blender/bmesh/operators/bmo_primitive.c +++ b/source/blender/bmesh/operators/bmo_primitive.c @@ -807,6 +807,7 @@ void BM_mesh_calc_uvs_grid(BMesh *bm, const float dx = 1.0f / (float)(x_segments - 1); const float dy = 1.0f / (float)(y_segments - 1); + const float dx_wrap = 1.0 - (dx / 2.0f); float x = 0.0f; float y = dy; @@ -844,7 +845,7 @@ void BM_mesh_calc_uvs_grid(BMesh *bm, } x += dx; - if (x >= 1.0f) { + if (x >= dx_wrap) { x = 0.0f; y += dy; } |