diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-08-24 15:51:31 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-08-24 15:51:31 +0300 |
commit | 1cac6fe542d92c6df04c420f432bb64627095221 (patch) | |
tree | 84186522726a07d391f1f8e7ef7991eefc045d42 | |
parent | be920fe786a092788b5baf7d19ce4e88982aab4b (diff) |
Fix selected UV vertex drawing ignoring size
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 81eaafbac3b..044fca2310c 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -486,7 +486,12 @@ static void draw_uvs(SpaceImage *sima, GPU_batch_uniform_4fv(batch->verts, "pinnedColor", pinned_col); GPU_batch_uniform_1f(batch->verts, "pointSize", (point_size + 1.5f) * M_SQRT2); GPU_batch_uniform_1f(batch->verts, "outlineWidth", 0.75f); - GPU_batch_draw(batch->verts); + + /* #GPU_batch_draw_advanced is needed as unbinding the shader and redrawing + * causes the vertices not to draw at the right size. */ + GPU_shader_bind(batch->verts->shader); + + GPU_batch_draw_advanced(batch->verts, 0, 0, 0, 0); /* We have problem in this mode when face order make some verts * appear unselected because an adjacent face is not selected and @@ -495,7 +500,11 @@ static void draw_uvs(SpaceImage *sima, * on top. A bit overkill but it's simple. */ GPU_batch_uniform_4fv(batch->verts, "vertColor", transparent); GPU_batch_uniform_4fv(batch->verts, "selectColor", col2); - GPU_batch_draw(batch->verts); + + GPU_batch_draw_advanced(batch->verts, 0, 0, 0, 0); + + GPU_shader_unbind(); + /* Finish #GPU_batch_draw_advanced drawing. */ GPU_blend(GPU_BLEND_NONE); GPU_program_point_size(false); |