mol_plot_all 1.2.434 → 1.2.436

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/node.test.js CHANGED
@@ -3683,6 +3683,8 @@ var $;
3683
3683
  let pos = this.pointer_center();
3684
3684
  if (!action_type)
3685
3685
  return;
3686
+ if (!start_pos)
3687
+ return;
3686
3688
  if (action_type === 'draw') {
3687
3689
  const distance = new $mol_vector(start_pos, pos).distance();
3688
3690
  if (distance >= 4) {
@@ -3690,8 +3692,6 @@ var $;
3690
3692
  }
3691
3693
  return;
3692
3694
  }
3693
- if (!start_pos)
3694
- return;
3695
3695
  if (action_type === 'pan') {
3696
3696
  this.dom_node().setPointerCapture(event.pointerId);
3697
3697
  this.pan(new $mol_vector_2d(start_pan[0] + pos[0] - start_pos[0], start_pan[1] + pos[1] - start_pos[1]));
@@ -3788,7 +3788,7 @@ var $;
3788
3788
  const action_type = this.event_eat(event);
3789
3789
  if (action_type === 'zoom') {
3790
3790
  const zoom_prev = this.zoom() || 0.001;
3791
- const zoom_next = zoom_prev * (1 - .001 * event.deltaY);
3791
+ const zoom_next = zoom_prev * (1 - .001 * Math.min(event.deltaY, 100));
3792
3792
  const mult = zoom_next / zoom_prev;
3793
3793
  this.zoom(zoom_next);
3794
3794
  const pan_prev = this.pan();