Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-05-14 08:55:21 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-05-14 08:55:21 +0400
commit3b8b62ea4e945621f53228657e584f3de7220432 (patch)
tree416358c171c935c993386b641c5916abf0d3fde7 /source
parentb31e03fdd149c56bab6f3ffe171e1403f35f3d17 (diff)
fix for problem where edge loop select would select too many vertices (extend selection too far),
before & after: http://www.graphicall.org/ftp/ideasman42/edgeloop_select_fix.png
Diffstat (limited to 'source')
-rw-r--r--source/blender/bmesh/intern/bmesh_walkers_impl.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c
index c966ee337db..286321b4921 100644
--- a/source/blender/bmesh/intern/bmesh_walkers_impl.c
+++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c
@@ -428,6 +428,15 @@ static void *bmw_IslandWalker_step(BMWalker *walker)
*
* Starts at a tool-flagged edge and walks over the edge loop
*/
+
+/* utility function */
+static bool bm_loop_is_single(BMLoop *l)
+{
+ return ((BM_edge_is_boundary(l->e)) &&
+ (l->f->len != 4) &&
+ (BM_edge_is_boundary(l->next->e) || BM_edge_is_boundary(l->prev->e)));
+}
+
static void bmw_LoopWalker_begin(BMWalker *walker, void *data)
{
BMwLoopWalker *lwalk = NULL, owalk, *owalk_pt;
@@ -444,7 +453,7 @@ static void bmw_LoopWalker_begin(BMWalker *walker, void *data)
lwalk->cur = lwalk->start = e;
lwalk->lastv = lwalk->startv = v;
lwalk->is_boundary = BM_edge_is_boundary(e);
- lwalk->is_single = (vert_edge_count[0] == 2 && vert_edge_count[1] == 2);
+ lwalk->is_single = (lwalk->is_boundary && bm_loop_is_single(e->l));
/* could also check that vertex*/
if ((lwalk->is_boundary == false) &&
@@ -639,6 +648,10 @@ static void *bmw_LoopWalker_step(BMWalker *walker)
} while (true);
}
+ if (owalk.is_single == false && bm_loop_is_single(l)) {
+ l = NULL;
+ }
+
if (l != NULL) {
if (l != e->l &&
bmw_mask_check_edge(walker, l->e) &&