Skip to content

Commit

Permalink
Merge pull request #134 from nomic-ai/fix-selection-mouseover
Browse files Browse the repository at this point in the history
fix selection mouseover
  • Loading branch information
bmschmidt authored Sep 4, 2024
2 parents 00bb71d + a194126 commit 4896c28
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
28 changes: 15 additions & 13 deletions src/glsl/general.vert
Original file line number Diff line number Diff line change
Expand Up @@ -1422,24 +1422,26 @@ void main() {
endSize = u_background_size;
endColor = u_background_rgba;
endColor.a *= fill.a;
// endColor.rgb = vec3(0., 0., 1.);
}
}

gl_PointSize *= mix(startSize, endSize, ease);
fill = mix(startColor, endColor, ease);

// Very light alphas must be quantized. Only show an appropriate sample.
if (fill.a < 1./255.) {
float seed = ix_to_random(ix, 38.6);
if (fill.a * 255. < seed) {
gl_Position = discard_me;
return;
} else {
fill.a = 1. / 255.;
}
if (u_color_picker_mode < 1.) {
fill = mix(startColor, endColor, ease);
// Very light alphas must be quantized. Only show an appropriate sample.
// Note -- this adjustment will not happen in color picking modes,
// which may occasionally result in one tiny point highlighted
// in favor of another point in the exact same place.
if (fill.a < 1./255.) {
float seed = ix_to_random(ix, 38.6);
if (fill.a * 255. < seed) {
gl_Position = discard_me;
return;
} else {
fill.a = 1. / 255.;
}
}
}

}
point_size = gl_PointSize;
/* if (u_use_glyphset > 0. && point_size > 5.0) {
Expand Down
5 changes: 3 additions & 2 deletions src/regl_rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -803,8 +803,9 @@ export class ReglRenderer extends Renderer {
// }
// return this.textures.empty_texture;
// },
//@ts-expect-error Don't know about regl preps.
u_color_picker_mode: regl.prop('color_picker_mode'),

u_color_picker_mode: (_: Color, { color_picker_mode }: P) =>
color_picker_mode,
u_position_interpolation_mode(_, props: P) {
// 1 indicates that there should be a continuous loop between the two points.
if (props.position_interpolation) {
Expand Down

0 comments on commit 4896c28

Please sign in to comment.