• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How do I bind Zoom in / Zoom Out to the middle mouse scroll wheel up and down?

New Here ,
Jul 01, 2018 Jul 01, 2018

Copy link to clipboard

Copied

I can't figure out how to bind it to the mouse wheel action. Thanks!

Views

5.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jul 02, 2018 Jul 02, 2018

Are you talking about in the editor, or in your content?

In the editor you can use the mousewheel to zoom in/out by holding down Ctrl at the same time.

Votes

Translate

Translate
Community Expert ,
Jul 02, 2018 Jul 02, 2018

Copy link to clipboard

Copied

Hi.

Try something like this:

function onMouseWheel(e)

{

     var delta;

     if (e == window.event)

          delta = -10 / window.event.wheelDeltaY;

     else

          delta = e.detail / 30;

     YOUR_MC.scaleX -= delta;

     YOUR_MC.scaleY = YOUR_MC.scaleX;

}

document.getElementById('canvas').addEventListener('mousewheel', onMouseWheel.bind(this));

document.getElementById('canvas').addEventListener('DOMMouseScroll', onMouseWheel.bind(this));

Regards,

JC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 02, 2018 Jul 02, 2018

Copy link to clipboard

Copied

Are you talking about in the editor, or in your content?

In the editor you can use the mousewheel to zoom in/out by holding down Ctrl at the same time.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 02, 2018 Jul 02, 2018

Copy link to clipboard

Copied

In the Editor! Thank you

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 03, 2018 Jul 03, 2018

Copy link to clipboard

Copied

LATEST

Because someone answered the question,

So this is just a discussion.

In fact, it is better to have a certain habit.

In fact, the main you zoom will affect the line weight, resulting in poor animation effect.

Because I also do animation mainly.

Currently recommended 2 methods.

1,

the stroke size is set to fixed. Select "Zoom in with the stage small"

Then CTRL + wheel.

Or

CTRL + = and CTRL +-

Zoom in and Zoom out.

2,

Cancel "Zoom out and stage small"

And then through the ctrl+1,2,3,4 switch.

This will make the drawing line automatically thinner

In addition, if the mouse has more than one key, you can set the custom key.

General drive will have, if not, you can download the Xmouse Settings button. It is best to enlarge, shrink, pen, and so on to set the mouse button.

http://www.highrez.co.uk/downloads/XMouseButtonControl.htm

111.gif

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines