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

Fixed select highlight (?), only do picking if no buttons are involved (makes...

Fixed select highlight (?), only do picking if no buttons are involved (makes rotation/zoom much faster)
parent 69821ac0
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment