# Webgl scaling interaction can be improved

**URL:** <https://discourse.processing.org/t/webgl-scaling-interaction-can-be-improved/32863>\
**Category:** Development\
**Created:** [October 16, 2021, 1:58pm UTC](https://discourse.processing.org/t/webgl-scaling-interaction-can-be-improved/32863 "2021-10-16T13:58:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yang](https://avatars.discourse-cdn.com/v4/letter/y/77aa72/32.png) [@yang](https://discourse.processing.org/u/yang)\
**Post date:** [October 16, 2021, 1:58pm UTC](https://discourse.processing.org/t/webgl-scaling-interaction-can-be-improved/32863/1 "2021-10-16T13:58:19Z")

</div>

Currently you can only scale between large and small. I suggest changing code like this in order to scale smoothly in interaction.js. “\_pmouseWheelDeltaY” may be removed.

```auto
const scaleFactor = 50;
  // ZOOM if there is a change in mouseWheelDelta
  if (this._mouseWheelDeltaY !=0) {
    // zoom according to direction of mouseWheelDeltaY rather than value
    if (this._mouseWheelDeltaY > 0) {
      this._renderer._curCamera._orbit(0, 0, sensitivityZ * scaleFactor);
    } else {
      this._renderer._curCamera._orbit(0, 0, -sensitivityZ * scaleFactor);
    }
    this._mouseWheelDeltaY =0;
  }

```

---

<div class="post-metadata">

**Author:** ![hotfooted](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hotfooted/32/3670_2.png) [@hotfooted](https://discourse.processing.org/u/hotfooted)\
**Post date:** [October 17, 2021, 12:56am UTC](https://discourse.processing.org/t/webgl-scaling-interaction-can-be-improved/32863/2 "2021-10-17T00:56:20Z")

</div>

you probably want to hit up the github page

for info on how to contribute  
[https://p5js.org/contributor-docs/#/](https://p5js.org/contributor-docs/#/)

and i believe the place to contribute

> **[GitHub - processing/p5.js: p5.js is a client-side JS platform that empowers...](https://github.com/processing/p5.js)**
>
> p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Proces...

---

<div class="post-metadata">

**Author:** ![yang](https://avatars.discourse-cdn.com/v4/letter/y/77aa72/32.png) [@yang](https://discourse.processing.org/u/yang)\
**Post date:** [October 17, 2021, 2:09am UTC](https://discourse.processing.org/t/webgl-scaling-interaction-can-be-improved/32863/3 "2021-10-17T02:09:27Z")

</div>

Thank you for your instructions, I’ve made a pull request.
