From 485b70aab57868f5d79bd10af01af10d0d4696bf Mon Sep 17 00:00:00 2001 From: Vladislav Poddubskii Date: Mon, 9 Dec 2024 14:17:33 +0000 Subject: [PATCH] Pull request #5389: Feature/DXCF-5029 dxcharts web touchpad chart scrolling improvement Merge in DXCHARTS/dxchart5 from feature/DXCF-5029-dxcharts-web-touchpad-chart-scrolling-improvement to master * commit '12f492412bfe0cb1b9b5bf5deb08cae8d5aa5c4d': [DXCF-5029] [dxCharts][Web] Touchpad chart scrolling improvement // code simplify [DXCF-5029] [dxCharts][Web] Touchpad chart scrolling improvement // scroll X change for apple and mobile GitOrigin-RevId: 26239d25c2fb8541684b00dbfaac838664383c10 --- src/chart/components/chart/chart-area-pan.handler.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/chart/components/chart/chart-area-pan.handler.ts b/src/chart/components/chart/chart-area-pan.handler.ts index f27b6fe..310ca9e 100644 --- a/src/chart/components/chart/chart-area-pan.handler.ts +++ b/src/chart/components/chart/chart-area-pan.handler.ts @@ -47,7 +47,7 @@ interface ChartPanningOptions { * @param {CanvasBoundsContainer} canvasBoundsContainer - An instance of the CanvasBoundsContainer class. * @param {CanvasAnimation} canvasAnimation - An instance of the CanvasAnimation class. * @param {ChartPanComponent} chartPanComponent - An instance of the ChartPanComponent class. - + */ export class ChartAreaPanHandler extends ChartBaseElement { private currentPoint: Point = { x: 0, y: 0 }; @@ -98,6 +98,7 @@ export class ChartAreaPanHandler extends ChartBaseElement { * If the zoomToCursor configuration is set to false, it calls the zoomXToEnd method of the scaleModel to zoom in or out based on the zoomIn parameter. * Finally, it fires the draw event of the bus to redraw the canvas. * @param {WheelEvent} e - Wheel event + * @param {number} zoomSensitivity - zoom sensitivity * @returns {void} */ private zoomXHandler = (e: WheelEvent, zoomSensitivity: number) => { @@ -137,9 +138,9 @@ export class ChartAreaPanHandler extends ChartBaseElement { ) .subscribe(e => { const device = deviceDetector(); - const direction = device === 'apple' || device === 'mobile' ? 1 : -1; + const direction = device === 'apple' || device === 'mobile' ? -1 : 1; const deltaX = 0 + e.deltaX * direction; - const deltaY = 0 + e.deltaY * -direction; + const deltaY = 0 + e.deltaY * direction; if (e.ctrlKey) { const zoomSensitivity = this.calculateDynamicSesitivity( @@ -192,7 +193,7 @@ export class ChartAreaPanHandler extends ChartBaseElement { /** * Registers a handler for panning the chart along the Y-axis. - * @param {ScaleModel} scaleModel - The scale model of the extent. + * @param {ScaleModel} scale - The scale model of the extent. * @param {HitBoundsTest} hitTest - The hit test of the pane. * @returns {DragNDropYComponent} - The drag and drop component for panning the chart along the Y-axis. */