mol_plot_all 1.2.434 → 1.2.435

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/web.js CHANGED
@@ -3241,6 +3241,8 @@ var $;
3241
3241
  let pos = this.pointer_center();
3242
3242
  if (!action_type)
3243
3243
  return;
3244
+ if (!start_pos)
3245
+ return;
3244
3246
  if (action_type === 'draw') {
3245
3247
  const distance = new $mol_vector(start_pos, pos).distance();
3246
3248
  if (distance >= 4) {
@@ -3248,8 +3250,6 @@ var $;
3248
3250
  }
3249
3251
  return;
3250
3252
  }
3251
- if (!start_pos)
3252
- return;
3253
3253
  if (action_type === 'pan') {
3254
3254
  this.dom_node().setPointerCapture(event.pointerId);
3255
3255
  this.pan(new $mol_vector_2d(start_pan[0] + pos[0] - start_pos[0], start_pan[1] + pos[1] - start_pos[1]));
@@ -3346,7 +3346,7 @@ var $;
3346
3346
  const action_type = this.event_eat(event);
3347
3347
  if (action_type === 'zoom') {
3348
3348
  const zoom_prev = this.zoom() || 0.001;
3349
- const zoom_next = zoom_prev * (1 - .001 * event.deltaY);
3349
+ const zoom_next = zoom_prev * (1 - .001 * Math.min(event.deltaY, 100));
3350
3350
  const mult = zoom_next / zoom_prev;
3351
3351
  this.zoom(zoom_next);
3352
3352
  const pan_prev = this.pan();