summaryrefslogtreecommitdiff
path: root/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Manipulators/Sequence/TrackZoom.cs
blob: fc167f4d7319f8e1f8fb7590b83e33b8ad49cc70 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using UnityEngine;
using UnityEngine.Timeline;

namespace UnityEditor.Timeline
{
    class TrackZoom : Manipulator
    {
        // only handles 'vertical' zoom. horizontal is handled in timelineGUI
        protected override bool MouseWheel(Event evt, WindowState state)
        {
            if (EditorGUI.actionKey)
            {
                state.trackScale = Mathf.Min(Mathf.Max(state.trackScale + (evt.delta.y * 0.1f), 1.0f), 100.0f);
                return true;
            }

            return false;
        }
    }
}