Fix Automation Point delete radius and size#3902
Conversation
5d8cc8d to
6a20f29
Compare
|
I found a much better way by adapting |
| // 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.
I just, cunningly, shot the line draw function to pieces with this line. 8P
6a20f29 to
6c98633
Compare
| pos_ticks = 0; | ||
| } | ||
| removePoints( m_drawLastTick, pos_ticks ); | ||
| Engine::getSong()->setModified(); |
There was a problem hiding this comment.
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.
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.
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.
@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.
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.
All right. I'll merge this tomorrow.
5dfd6a3 to
f8d4a8b
Compare
| return; | ||
| } | ||
|
|
||
| if( x0 < x1) |
There was a problem hiding this comment.
This looks somewhat odd. Space after (, but no space before ).
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