diff --git a/src/mol-app/ui/visualization/viewport.tsx b/src/mol-app/ui/visualization/viewport.tsx index 11fef7e54188e2e620b476cf69adcdc15f618a4b..ba402a6d7d1f6e81e1968b11a02d635bc78c209c 100644 --- a/src/mol-app/ui/visualization/viewport.tsx +++ b/src/mol-app/ui/visualization/viewport.tsx @@ -158,19 +158,21 @@ export class Viewport extends View<ViewportController, ViewportState, { noWebGl? viewer.input.resize.subscribe(() => this.handleResize()) - viewer.input.move.subscribe(({x, y, inside}) => { - if (!inside) return + // TODO: clear highlight on mouse/touch down? + + viewer.input.move.subscribe(({x, y, inside, buttons}) => { + if (!inside || buttons) return const p = viewer.identify(x, y) const loci = viewer.getLoci(p) InteractivityEvents.HighlightLoci.dispatch(this.controller.context, loci); - + // TODO use LabelLoci event and make configurable const label = labelFirst(loci) const info = `Object: ${p.objectId}, Instance: ${p.instanceId}, Element: ${p.elementId}, Label: ${label}` this.setState({ info }) }) - // TODO filter only for left button? + // TODO filter only for left button/single finger touch? viewer.input.click.subscribe(({x, y}) => { const loci = viewer.getLoci(viewer.identify(x, y)) InteractivityEvents.SelectLoci.dispatch(this.controller.context, loci); diff --git a/src/mol-gl/shader/chunks/apply-marker-color.glsl b/src/mol-gl/shader/chunks/apply-marker-color.glsl index c457e1b7585ad44b1e8d7ac2c5baa13854b52bc9..0c73020b06f145938655deeb00b56b625792f1be 100644 --- a/src/mol-gl/shader/chunks/apply-marker-color.glsl +++ b/src/mol-gl/shader/chunks/apply-marker-color.glsl @@ -1,4 +1,4 @@ -float marker = vMarker * 255.0; +float marker = vMarker * 256.0; if (marker > 0.1) { if (mod(marker, 2.0) < 0.1) { gl_FragColor.rgb = mix(uHighlightColor, gl_FragColor.rgb, 0.3);