Skip to content

Commit 2f671ef

Browse files
committed
Issue #5998: need to compare absolute delta!
1 parent a6864bb commit 2f671ef

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/Wt/WAbstractItemView.C

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include "SizeHandle.h"
2222
#include "WebUtils.h"
2323

24+
#include <cstdlib>
25+
2426
namespace Wt {
2527

2628
LOGGER("WAbstractItemView");
@@ -1342,9 +1344,10 @@ void WAbstractItemView::expandColumn(int columnid)
13421344
void WAbstractItemView::handleClick(const WModelIndex& index,
13431345
const WMouseEvent& event)
13441346
{
1345-
if (dragEnabled_ && delayedClearAndSelectIndex_.isValid() &&
1346-
event.dragDelta().x < 4 && event.dragDelta().y < 4) {
1347-
select(delayedClearAndSelectIndex_, SelectionFlag::ClearAndSelect);
1347+
if (dragEnabled_ && delayedClearAndSelectIndex_.isValid()) {
1348+
Coordinates delta = event.dragDelta();
1349+
if (std::abs(delta.x) < 4 && std::abs(delta.y) < 4)
1350+
select(delayedClearAndSelectIndex_, SelectionFlag::ClearAndSelect);
13481351
}
13491352

13501353
bool doEdit = index.isValid() && editTriggers().test(EditTrigger::SingleClicked);

0 commit comments

Comments
 (0)