Skip to content

Commit

Permalink
feat: avoid from > to in manual zone selection (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
jobo322 committed Apr 19, 2021
1 parent 7b95026 commit 326ed14
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/data/data2d/Datum2D.ts
Expand Up @@ -506,6 +506,9 @@ export function getSubMatrix(datum, selectedZone) {
let xIndexTo = Math.floor((toX - data.minX) / xStep);
let yIndexTo = Math.floor((toY - data.minY) / yStep);

if (xIndexFrom > xIndexTo) [xIndexFrom, xIndexTo] = [xIndexTo, xIndexFrom];
if (yIndexFrom > yIndexTo) [yIndexFrom, yIndexTo] = [yIndexTo, yIndexFrom];

let dataMatrix: any = {
z: [],
maxX: data.minX + xIndexTo * xStep,
Expand Down

0 comments on commit 326ed14

Please sign in to comment.