From 2a075558ce998da1ddfa9b0e520b87ba5a00206b Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 13 Jun 2016 19:02:06 -0400 Subject: [PATCH] Suppress duplicate tool dock points that don't give distinct results --- src/toolbars/ToolDock.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/toolbars/ToolDock.cpp b/src/toolbars/ToolDock.cpp index e74bc004c..72ba884f0 100644 --- a/src/toolbars/ToolDock.cpp +++ b/src/toolbars/ToolDock.cpp @@ -714,8 +714,13 @@ ToolBarConfiguration::Position // Else, only if the fit is possible. if (ct || (sz.x <= rect.width && sz.y <= rect.height)) { // May choose current or previous. - if (ct && point.y < (rect.GetTop() + rect.GetBottom()) / 2) - // "Wedge" the bar into a crack alone, not adopting others + if (ct && + (sz.y < rect.height || + point.y < (rect.GetTop() + rect.GetBottom()) / 2)) + // "Wedge" the bar into a crack alone, not adopting others, + // if either a short bar displaces a tall one, or else + // the displacing bar is at least at tall, but the pointer is + // in the upper half of the box. usedPrev = true, result = prevPosition, result.adopt = false; else result = position;