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

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

Community Beginner ,
Jul 01, 2018 Jul 01, 2018

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

5.7K
Translate
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.

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

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

Translate
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

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.

Translate
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
Community Beginner ,
Jul 02, 2018 Jul 02, 2018

In the Editor! Thank you

Translate
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
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

Translate
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