Merge pull request #14940 from roidelapluie/subsecondzoom
UI: Disallow sub-second zoom as this cause inconsistenices in the X axis in uPlot
This commit is contained in:
commit
c36589a6dd
|
@ -380,10 +380,11 @@ export const getUPlotOptions = (
|
|||
hooks: {
|
||||
setSelect: [
|
||||
(self: uPlot) => {
|
||||
onSelectRange(
|
||||
self.posToVal(self.select.left, "x"),
|
||||
self.posToVal(self.select.left + self.select.width, "x")
|
||||
);
|
||||
// Disallow sub-second zoom as this cause inconsistenices in the X axis in uPlot.
|
||||
const leftVal = self.posToVal(self.select.left, "x");
|
||||
const rightVal = Math.max(self.posToVal(self.select.left + self.select.width, "x"), leftVal + 1);
|
||||
|
||||
onSelectRange(leftVal, rightVal);
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue