Update RateScale.js
This commit is contained in:
1 parent
befa4aa868
commit
3328cb73ed
1 file changed
+1
-4
+1
-4
@@ -347,17 +347,14 @@ function newRateScale () {
|
||||
|
||||
function onUpstreamScaleChanged (event) {
|
||||
if (event === undefined) { return }
|
||||
if (event.dragVector.y === 0) { return }
|
||||
if (event.type === 'center dragged') {
|
||||
let point = {
|
||||
x: event.dragVector.x,
|
||||
y: -event.dragVector.y
|
||||
}
|
||||
let newMinDate = getDateFromPointAtContainer(point, rateCalculationsContainer, coordinateSystem)
|
||||
let newMaxRate = getRateFromPointAtContainer(point, rateCalculationsContainer, coordinateSystem)
|
||||
let xDifferenceMaxMin = coordinateSystem.max.x - coordinateSystem.min.x
|
||||
let yDifferenceMaxMin = coordinateSystem.max.y - coordinateSystem.min.y
|
||||
coordinateSystem.min.x = newMinDate.valueOf()
|
||||
coordinateSystem.max.x = newMinDate.valueOf() + xDifferenceMaxMin
|
||||
coordinateSystem.min.y = newMaxRate - yDifferenceMaxMin
|
||||
coordinateSystem.max.y = newMaxRate
|
||||
|
||||
|
||||
Reference in new issue
Block a user