Skip to content

Commit 93b2449

Browse files
onPan: Remove actualDelta which was meant to indicate which scale was panned in favor of conciseness.
1 parent ea1ee46 commit 93b2449

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/core.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,21 +221,18 @@ export function pan(chart: Chart, delta: PanAmount, enabledScales?: Scale[], tra
221221
const yEnabled = y !== 0
222222

223223
const scales = enabledScales || Object.values(chart.scales)
224-
const actualDelta = { x: 0, y: 0 }
225224

226225
for (const scale of scales) {
227226
if (scale.isHorizontal() && xEnabled) {
228-
actualDelta.x = x
229227
panScale(scale, x, limits, state)
230228
} else if (!scale.isHorizontal() && yEnabled) {
231-
actualDelta.y = y
232229
panScale(scale, y, limits, state)
233230
}
234231
}
235232

236233
chart.update(transition)
237234

238-
onPan?.({ chart, trigger, delta: actualDelta })
235+
onPan?.({ chart, trigger, delta: { x, y } })
239236
}
240237

241238
export function getInitialScaleBounds(chart: Chart) {

0 commit comments

Comments
 (0)