protected override bool MouseDrag(Event evt, WindowState state) { // Note: Do not rely on evt.button here as some 3rd party automation // software does not properly set the button data during drag. if (!m_Active) { return(false); } var cursorRect = TimelineWindow.instance.sequenceContentRect; cursorRect.xMax = TimelineWindow.instance.position.xMax; cursorRect.yMax = TimelineWindow.instance.position.yMax; if (state.GetWindow() != null && state.GetWindow().treeView != null) { var scroll = state.GetWindow().treeView.scrollPosition; scroll.y -= evt.delta.y; state.GetWindow().treeView.scrollPosition = scroll; state.OffsetTimeArea((int)evt.delta.x); return(true); } return(false); }
static bool Pan(Event evt, WindowState state) { var cursorRect = TimelineWindow.instance.sequenceContentRect; cursorRect.xMax = TimelineWindow.instance.position.xMax; cursorRect.yMax = TimelineWindow.instance.position.yMax; if (state.GetWindow() != null && state.GetWindow().treeView != null) { var scroll = state.GetWindow().treeView.scrollPosition; scroll.y -= evt.delta.y; state.GetWindow().treeView.scrollPosition = scroll; state.OffsetTimeArea((int)evt.delta.x); return(true); } return(false); }