Skip to content

Commit

Permalink
Has the OSD viewer controls fade changed when the reduce animations s…
Browse files Browse the repository at this point in the history
…etting is changed. (#1172)
  • Loading branch information
LlGC-jop authored Oct 24, 2024
1 parent 0687aba commit a15f38f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export class OpenSeadragonCenterPanel extends CenterPanel<
IIIFEvents.SETTINGS_CHANGE,
(args: ISettings) => {
this.viewer.gestureSettingsMouse.clickToZoom = args.clickToZoomEnabled;
this.viewer.controlsFadeLength = this.getControlsFadeLength();
}
);

Expand Down Expand Up @@ -250,7 +251,7 @@ export class OpenSeadragonCenterPanel extends CenterPanel<
defaultZoomLevel: this.config.options.defaultZoomLevel || 0,
maxZoomPixelRatio: this.config.options.maxZoomPixelRatio || 2,
controlsFadeDelay: this.config.options.controlsFadeDelay || 250,
controlsFadeLength: this.config.options.controlsFadeLength || 250,
controlsFadeLength: this.getControlsFadeLength(),
navigatorPosition:
this.config.options.navigatorPosition || "BOTTOM_RIGHT",
navigatorHeight: "100px",
Expand Down Expand Up @@ -1463,4 +1464,8 @@ export class OpenSeadragonCenterPanel extends CenterPanel<
}
}
}

getControlsFadeLength(): number {
return (<ISettings>this.extension.getSettings()).reducedAnimation ? 0 : this.config.options.controlsFadeLength || 250;
}
}

0 comments on commit a15f38f

Please sign in to comment.