@devexperts/dxcharts-lite
Version:
28 lines (27 loc) • 928 B
JavaScript
/*
* Copyright (C) 2019 - 2026 Devexperts Solutions IE Limited
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
/**
* Moves both xStart and xEnd without changing the viewport width (zoomX).
* @param state
* @param xStart - left starting point in units
* @doc-tags scaling,viewport
*/
export const moveXStart = (state, xStart) => {
const prev = state.xStart;
state.xStart = xStart;
state.xEnd = state.xEnd + (xStart - prev);
};
/**
* Moves both yStart and yEnd without changing the viewport height (zoomY).
* @param state
* @param yStart - starting point in units
* @doc-tags scaling,viewport
*/
export const moveYStart = (state, yStart) => {
const prev = state.yStart;
state.yStart = yStart;
state.yEnd = state.yEnd + (yStart - prev);
};