diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-01-10 19:59:11 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-01-11 18:00:23 +0300 |
commit | 621a6d4a5de872a94f81d239ff627d24afecc56b (patch) | |
tree | e5b563f388f9a7f635b8255549c33b49d1ce83ff /source/blender/editors/uvedit | |
parent | 5f3fdee53a3e2716013147029e6da9e90e2c8ba8 (diff) |
UVEdit: Add back uv angle stretch aspect correction
This is now done in shader so that the batches are shared across ImageUV
areas.
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 30bc6301487..46c62c4a086 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -305,7 +305,9 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit, Depsgraph * if (faces) { GPU_batch_program_set_builtin(faces, (draw_stretch) - ? GPU_SHADER_2D_UV_FACES_STRETCH + ? (sima->dt_uvstretch == SI_UVDT_STRETCH_AREA) + ? GPU_SHADER_2D_UV_FACES_STRETCH_AREA + : GPU_SHADER_2D_UV_FACES_STRETCH_ANGLE : GPU_SHADER_2D_UV_FACES); if (!draw_stretch) { @@ -319,6 +321,11 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit, Depsgraph * GPU_batch_uniform_4fv(faces, "selectColor", col2); GPU_batch_uniform_4fv(faces, "activeColor", col3); } + else if (sima->dt_uvstretch == SI_UVDT_STRETCH_ANGLE) { + float asp[2]; + ED_space_image_get_uv_aspect(sima, &asp[0], &asp[1]); + GPU_batch_uniform_2fv(faces, "aspect", asp); + } GPU_batch_draw(faces); |