-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify zoom and snap calculations, remove TextFloat #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,7 +125,7 @@ ClipView::ClipView( Clip * clip, | |
|
||
connect( m_clip, SIGNAL(lengthChanged()), | ||
this, SLOT(updateLength())); | ||
connect(getGUI()->songEditor()->m_editor->zoomingLinearModelSlider(), SIGNAL(dataChanged()), this, SLOT(updateLength())); | ||
connect(getGUI()->songEditor()->m_editor, &SongEditor::pixelsPerBarChanged, this, &ClipView::updateLength); | ||
connect( m_clip, SIGNAL(positionChanged()), | ||
this, SLOT(updatePosition())); | ||
connect( m_clip, SIGNAL(destroyedClip()), this, SLOT(close())); | ||
|
@@ -314,8 +314,7 @@ void ClipView::updateLength() | |
} | ||
else | ||
{ | ||
// 3 is the minimun width needed to paint a clip | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically the border width is 2 pixels so minimum width of a clip would be 5. But it works even if pixelsPerBar is 1. So I don't see a need to enforce a minimum here... Just don't let zoom get to small. Or am I missing something? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was needed for clips that do not start or end at beat times (Alt+mouse, to move start or end of the clip) and an "extreme" zoom in (clip disappears). It happens with your code as well. I think we should reintroduce that control again. |
||
setFixedWidth(std::max(static_cast<int>(m_clip->length() * pixelsPerBar() / TimePos::ticksPerBar() + 1), 3)); | ||
setFixedWidth(static_cast<int>(m_clip->length() * pixelsPerBar() / TimePos::ticksPerBar() + 1)); | ||
} | ||
m_trackView->trackContainerView()->update(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed it back to zoomingModel, since there is only one now.