TrackViewTimeline.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "EditorDefs.h"
  9. #include "TrackViewTimeline.h"
  10. // Editor
  11. #include "AnimationContext.h"
  12. namespace TrackView
  13. {
  14. void CTrackViewTimelineWidget::mousePressEvent(QMouseEvent* event)
  15. {
  16. m_stashedRecordModeWhileTimeDragging = GetIEditor()->GetAnimation()->IsRecordMode();
  17. GetIEditor()->GetAnimation()->SetRecording(false); // disable recording while dragging time
  18. TimelineWidget::mousePressEvent(event);
  19. }
  20. void CTrackViewTimelineWidget::mouseReleaseEvent(QMouseEvent* event)
  21. {
  22. TimelineWidget::mouseReleaseEvent(event);
  23. if (m_stashedRecordModeWhileTimeDragging)
  24. {
  25. GetIEditor()->GetAnimation()->SetRecording(true); // restore recording
  26. m_stashedRecordModeWhileTimeDragging = false; // reset stash
  27. }
  28. }
  29. } // namespace TrackView