Skip to content

Commit

Permalink
[brush] fix brush selector lineX lineY when select only one item.
Browse files Browse the repository at this point in the history
  • Loading branch information
100pah committed Jan 24, 2017
1 parent 90f89a2 commit 33c041e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/component/brush/selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,15 @@ define(function(require) {
},
rect: function (itemLayout, selectors, area) {
var range = area.range;
return inLineRange(itemLayout[xy[xyIndex]], range)
|| inLineRange(itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]], range);
var layoutRange = [
itemLayout[xy[xyIndex]],
itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]
];
layoutRange[1] < layoutRange[0] && layoutRange.reverse();
return inLineRange(layoutRange[0], range)
|| inLineRange(layoutRange[1], range)
|| inLineRange(range[0], layoutRange)
|| inLineRange(range[1], layoutRange);
}
};
}
Expand Down

0 comments on commit 33c041e

Please sign in to comment.