Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Scope variables more tightly
  • Loading branch information
DomClark committed Dec 22, 2023
commit 9ac308020b2e7af73fb4bd7bd03aaa0f29cbb72d
7 changes: 4 additions & 3 deletions src/gui/editors/TimeLineWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,13 @@ void TimeLineWidget::paintEvent( QPaintEvent * )

// Draw loop handles if necessary
const auto handleMode = ConfigManager::inst()->value("app", "loopmarkermode") == "handles";
const auto hw = std::min(m_loopHandleWidth, loopRectWidth / 2 - 1);
const auto leftHandle = QRectF(loopStart - .5, loopRectMargin - .5, hw, loopRectHeight);
const auto rightHandle = QRectF(loopEndR - hw - .5, loopRectMargin - .5, hw, loopRectHeight);
if (handleMode && underMouse() && QGuiApplication::keyboardModifiers().testFlag(Qt::ShiftModifier))
{
const auto handleWidth = std::min(m_loopHandleWidth, loopRectWidth / 2 - 1);
const auto leftHandle = QRectF(loopStart - .5, loopRectMargin - .5, handleWidth, loopRectHeight);
const auto rightHandle = QRectF(loopEndR - handleWidth - .5, loopRectMargin - .5, handleWidth, loopRectHeight);
const auto color = loopPointsActive ? m_activeLoopHandleColor : m_inactiveLoopHandleColor;

p.fillRect(leftHandle, color);
p.fillRect(rightHandle, color);
}
Expand Down