Skip to content
Snippets Groups Projects
Commit b178fdef authored by David Sehnal's avatar David Sehnal
Browse files

mol-plugin: Camera focus duration default value fix

parent 453d6006
No related branches found
No related tags found
No related merge requests found
......@@ -35,12 +35,13 @@ export const FocusLoci = PluginBehavior.create<FocusLociProps>({
this.subscribeObservable(this.ctx.behaviors.interaction.click, ({ current, buttons, modifiers }) => {
if (!this.ctx.canvas3d) return;
const p = this.params
const p = this.params;
const durationMs = typeof p.durationMs === 'undefined' ? 250 : p.durationMs;
if (Binding.match(this.params.bindings.clickCenterFocus, buttons, modifiers)) {
const sphere = Loci.getBoundingSphere(current.loci);
if (sphere) {
const radius = Math.max(sphere.radius + p.extraRadius, p.minRadius);
this.ctx.canvas3d.camera.focus(sphere.center, radius, p.durationMs);
this.ctx.canvas3d.camera.focus(sphere.center, radius, durationMs);
}
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment