Skip to content

Commit 698376e

Browse files
committed
off-by-one error in select outline
1 parent d02d612 commit 698376e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/plots/cartesian/select.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
9595
// extras to guide users in keeping a straight selection
9696
corners.attr('d', 'M' + poly.xmin + ',' + (y0 - MINDRAG) +
9797
'h-4v' + (2 * MINDRAG) + 'h4Z' +
98-
'M' + poly.xmax + ',' + (y0 - MINDRAG) +
98+
'M' + (poly.xmax - 1) + ',' + (y0 - MINDRAG) +
9999
'h4v' + (2 * MINDRAG) + 'h-4Z');
100100

101101
}
@@ -104,7 +104,7 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
104104
poly = polygonTester([[0, y0], [0, y1], [pw, y1], [pw, y0]]);
105105
corners.attr('d', 'M' + (x0 - MINDRAG) + ',' + poly.ymin +
106106
'v-4h' + (2 * MINDRAG) + 'v4Z' +
107-
'M' + (x0 - MINDRAG) + ',' + poly.ymax +
107+
'M' + (x0 - MINDRAG) + ',' + (poly.ymax - 1) +
108108
'v4h' + (2 * MINDRAG) + 'v-4Z');
109109
}
110110
else {
@@ -113,7 +113,8 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {
113113
corners.attr('d','M0,0Z');
114114
}
115115
outlines.attr('d', 'M' + poly.xmin + ',' + poly.ymin +
116-
'H' + poly.xmax + 'V' + poly.ymax + 'H' + poly.xmin + 'Z');
116+
'H' + (poly.xmax - 1) + 'V' + (poly.ymax - 1) +
117+
'H' + poly.xmin + 'Z');
117118
}
118119
else if(mode === 'lasso') {
119120
pts.addPt([x1, y1]);

0 commit comments

Comments
 (0)