-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix Automation Point delete radius and size #3902
Fix Automation Point delete radius and size #3902
Conversation
5d8cc8d
to
6a20f29
Compare
I found a much better way by adapting |
src/gui/editors/AutomationEditor.cpp
Outdated
@@ -507,6 +507,7 @@ void AutomationEditor::mousePressEvent( QMouseEvent* mouseEvent ) | |||
// get tick in which the user clicked | |||
int pos_ticks = x * MidiTime::ticksPerTact() / m_ppt + | |||
m_currentPosition; | |||
m_drawLastTick = pos_ticks; |
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 just, cunningly, shot the line draw function to pieces with this line. 8P
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.
Fixed.
6a20f29
to
6c98633
Compare
} | ||
removePoints( m_drawLastTick, pos_ticks ); | ||
Engine::getSong()->setModified(); |
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.
It will mark the project as modified if no points are removed. It should be moved into removePoints()
.
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 remove points without checking if there are any there. So if I add bool pointsRemoved = false;
and lets the delete loop set it to true, it is still going to set the project to changed as soon as the mouse moves just a bit without really removing anything.
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.
The behaviour right now is, deleting points with right click sets the project to changed but deleting by dragging over points doesn't.
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.
@PhysSong I don't know quite how to move Engine::getSong()->setModified();
to removePoints()
. This is already an improvement from before when setModified() wasn't called at all. I suggest merging this 'as is', or I can have another look at it if someone can point me in the right direction but for now I think it's low priority.
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.
Engine::getSong()->setModified();
is an UX problem. So I think it's out of scope a little bit. Since the point of this PR is on GUI part, merging as-is looks fine. Dropping that will be fine, too.
I can create a PR which fixes the UX issue later. I think it will be the best way. 👍
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.
All right. I'll merge this tomorrow.
5dfd6a3
to
f8d4a8b
Compare
src/gui/editors/AutomationEditor.cpp
Outdated
return; | ||
} | ||
|
||
if( x0 < x1) |
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.
This looks somewhat odd. Space after (
, but no space before )
.
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.
Fixed.
f8d4a8b
to
61d8dd4
Compare
* Fix Automation Point delete radius. At lower zoom deleting would miss automation points to delete and at higher zoom it would be too generous and remove neighbouring points. * Increase smallest Automation Point radius. For visibility. The smallest Automatin Point radius was tiny.
Exchange defective algorithm for Automatin Point delete radius with a new function adapted from
AutomationEditor::drawLine()
,Increase minimal Automation Point radius by 50%.
The sensitivity for grabbing/moving an Automation Point is still a bit off on the fines quantization levels.
Fixes #3896