Skip to content

Commit 76474e8

Browse files
committed
adopt pixelRound
1 parent 9aee58d commit 76474e8

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/interactions/brush.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
} from "d3";
1111
import {composeRender, Mark} from "../mark.js";
1212
import {constant, keyword, maybeInterval} from "../options.js";
13-
import {pixelPrecision} from "../precision.js";
13+
import {pixelRound} from "../precision.js";
1414

1515
export class Brush extends Mark {
1616
constructor({dimension = "xy", interval, sync = false} = {}) {
@@ -294,7 +294,6 @@ function renderFilter(initialTest) {
294294

295295
function precisionInvert(scale, projection) {
296296
if (projection || !scale?.invert) return (d) => d;
297-
const interval = pixelPrecision(scale);
298-
if (interval == null) return scale.invert.bind(scale);
299-
return (p) => interval.floor(scale.invert(p));
297+
const round = pixelRound(scale);
298+
return (p) => round(scale.invert(p));
300299
}

0 commit comments

Comments
 (0)