Skip to content

Commit

Permalink
fix: stackScroll should honor invert configuration (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi committed Oct 5, 2022
1 parent 4988414 commit aa8f1c4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/tools/src/tools/StackScrollTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ class StackScrollTool extends BaseTool {
_dragCallback(evt: EventTypes.MouseDragEventType) {
const { deltaPoints, viewportId, renderingEngineId } = evt.detail;
const { viewport } = getEnabledElementByIds(viewportId, renderingEngineId);

const targetId = this.getTargetId(viewport);
const { debounceIfNotLoaded } = this.configuration;
const { debounceIfNotLoaded, invert } = this.configuration;

const deltaPointY = deltaPoints.canvas[1];

Expand All @@ -59,7 +60,7 @@ class StackScrollTool extends BaseTool {
const imageIdIndexOffset = Math.round(deltaY / pixelsPerImage);

scroll(viewport, {
delta: imageIdIndexOffset,
delta: invert ? -imageIdIndexOffset : imageIdIndexOffset,
volumeId,
debounceLoading: debounceIfNotLoaded,
});
Expand Down

0 comments on commit aa8f1c4

Please sign in to comment.