diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2022-06-03 06:10:36 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-06-03 06:14:20 +0300 |
commit | c4701a027fed83d2aea4f0f26a845e4d6852b1ff (patch) | |
tree | f02358a04ef56b548d3d27d0be4f45e675526f3f /source/blender/editors/uvedit | |
parent | 2d9c5f3dcf2e039a1f46161aa6eb988b48c5d0f7 (diff) |
Fix T98558: island selection in UV editor can crash
Regression in [0]. When zoomed in, we can be within the face of an
island but too far from an edge, in this case
uv_find_nearest_face_multi_ex is used instead of
uv_find_nearest_edge_multi with the consequence that hit.l cannot be
used in uvedit_uv_select_test (it is NULL).
Instead, use uvedit_face_select_test instead in this case.
[0]: d356edf420ba13b3a544dcc598a0e31a36e1d86c
Reviewed By: campbellbarton
Ref D15100
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_select.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/uvedit/uvedit_select.c b/source/blender/editors/uvedit/uvedit_select.c index 6405d2df66a..a999c9b491f 100644 --- a/source/blender/editors/uvedit/uvedit_select.c +++ b/source/blender/editors/uvedit/uvedit_select.c @@ -2493,8 +2493,15 @@ static bool uv_mouse_select_multi(bContext *C, else if (selectmode == UV_SELECT_EDGE) { is_selected = uvedit_edge_select_test(scene, hit.l, cd_loop_uv_offset); } - else { /* Vertex or island. */ - is_selected = uvedit_uv_select_test(scene, hit.l, cd_loop_uv_offset); + else { + /* Vertex or island. For island (if we were using #uv_find_nearest_face_multi_ex, see above), + * `hit.l` is NULL, use `hit.efa` instead. */ + if (hit.l != NULL) { + is_selected = uvedit_uv_select_test(scene, hit.l, cd_loop_uv_offset); + } + else { + is_selected = uvedit_face_select_test(scene, hit.efa, cd_loop_uv_offset); + } } } |