From ee6bfc75409d9caffa634d61b10cab5656bf0c54 Mon Sep 17 00:00:00 2001 From: Andy Dufilie Date: Wed, 17 Feb 2016 16:40:21 -0500 Subject: [PATCH] replaced drag selection XOR with more reasonable behavior. --- src/drag.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drag.js b/src/drag.js index 56ab070..d4e526e 100644 --- a/src/drag.js +++ b/src/drag.js @@ -47,11 +47,11 @@ c3_chart_internal_fn.drag = function (mouse) { // line/area selection not supported yet return; } - if (isWithin ^ isIncluded) { - shape.classed(CLASS.INCLUDED, !isIncluded); + if (isWithin ^ isSelected || isWithin ^ isIncluded) { + shape.classed(CLASS.INCLUDED, isWithin); // TODO: included/unincluded callback here - shape.classed(CLASS.SELECTED, !isSelected); - toggle.call($$, !isSelected, shape, d, i); + shape.classed(CLASS.SELECTED, isWithin); + toggle.call($$, isWithin, shape, d, i); } }); };