Fix T78494: Edge slide crashes

Introduced in recent commit 9c29803255.
This commit is contained in:
Campbell Barton 2020-07-01 21:28:27 +10:00
parent 86e41ca775
commit 323c5e1e0b
Notes: blender-bot 2023-02-14 06:49:54 +01:00
Referenced by issue #78489, Crash on Offset Edge Slide
Referenced by issue #78494, Pressing "G" twice in edit mode and sliding past the edge with snapping set to increment crashes blender.
1 changed files with 4 additions and 1 deletions

View File

@ -1252,11 +1252,14 @@ void drawEdgeSlide(TransInfo *t)
TransDataEdgeSlideVert *curr_sv = &sld->sv[sld->curr_sv_index];
const int alpha_shade = -160;
float co_dir[3];
add_v3_v3v3(co_dir, curr_sv->v_co_orig, curr_sv->dir_side[sld->curr_side_unclamp]);
GPU_line_width(line_size);
immUniformThemeColorShadeAlpha(TH_EDGE_SELECT, 80, alpha_shade);
immBeginAtMost(GPU_PRIM_LINES, 2);
immVertex3fv(pos, curr_sv->v_side[sld->curr_side_unclamp]->co);
immVertex3fv(pos, curr_sv->v_co_orig);
immVertex3fv(pos, co_dir);
immEnd();
}