Skip to content

Commit 36e5526

Browse files
committed
Don’t floor brush extent.
When the brush extent is set explicitly, use the exact values to set the displayed position of the brush, rather than flooring the pixel coordinates. This ensures a consistent appearance with other elements, such as an axis, that may be rendered with shape-rendering: crispEdges.
1 parent 1c88fc2 commit 36e5526

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

d3.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8211,7 +8211,7 @@ d3 = function() {
82118211
max = position;
82128212
}
82138213
}
8214-
if (extent[0] ^ min | extent[1] ^ max) {
8214+
if (extent[0] != min || extent[1] != max) {
82158215
if (i) yExtentDomain = null; else xExtentDomain = null;
82168216
extent[0] = min;
82178217
extent[1] = max;
@@ -8275,15 +8275,15 @@ d3 = function() {
82758275
xExtentDomain = [ x0, x1 ];
82768276
if (x.invert) x0 = x(x0), x1 = x(x1);
82778277
if (x1 < x0) t = x0, x0 = x1, x1 = t;
8278-
if (x0 ^ xExtent[0] | x1 ^ xExtent[1]) xExtent = [ x0 | 0, x1 | 0 ];
8278+
if (x0 != xExtent[0] || x1 != xExtent[1]) xExtent = [ x0, x1 ];
82798279
}
82808280
if (y) {
82818281
y0 = z[0], y1 = z[1];
82828282
if (x) y0 = y0[1], y1 = y1[1];
82838283
yExtentDomain = [ y0, y1 ];
82848284
if (y.invert) y0 = y(y0), y1 = y(y1);
82858285
if (y1 < y0) t = y0, y0 = y1, y1 = t;
8286-
if (y0 ^ yExtent[0] | y1 ^ yExtent[1]) yExtent = [ y0 | 0, y1 | 0 ];
8286+
if (y0 != yExtent[0] || y1 != yExtent[1]) yExtent = [ y0, y1 ];
82878287
}
82888288
return brush;
82898289
};
@@ -8295,7 +8295,7 @@ d3 = function() {
82958295
return brush;
82968296
};
82978297
brush.empty = function() {
8298-
return !!x && xExtent[0] === xExtent[1] || !!y && yExtent[0] === yExtent[1];
8298+
return !!x && xExtent[0] == xExtent[1] || !!y && yExtent[0] == yExtent[1];
82998299
};
83008300
return d3.rebind(brush, event, "on");
83018301
};

0 commit comments

Comments
 (0)