Skip to content
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

Merged
merged 2 commits into from
Oct 24, 2017

Conversation

zonkmachine
Copy link
Member

@zonkmachine zonkmachine commented Oct 22, 2017

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

@zonkmachine zonkmachine requested a review from Umcaruje October 22, 2017 18:27
@zonkmachine zonkmachine force-pushed the automationpointissues branch 2 times, most recently from 5d8cc8d to 6a20f29 Compare October 22, 2017 21:35
@zonkmachine
Copy link
Member Author

I found a much better way by adapting AutomationEditor::drawLine().

@@ -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;
Copy link
Member Author

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@zonkmachine zonkmachine force-pushed the automationpointissues branch from 6a20f29 to 6c98633 Compare October 22, 2017 22:22
}
removePoints( m_drawLastTick, pos_ticks );
Engine::getSong()->setModified();
Copy link
Member

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().

Copy link
Member Author

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.

Copy link
Member Author

@zonkmachine zonkmachine Oct 22, 2017

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.

Copy link
Member Author

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.

Copy link
Member

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. 👍

Copy link
Member Author

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.

@zonkmachine zonkmachine force-pushed the automationpointissues branch from 5dfd6a3 to f8d4a8b Compare October 23, 2017 06:58
return;
}

if( x0 < x1)
Copy link
Member

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 ).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@zonkmachine zonkmachine force-pushed the automationpointissues branch from f8d4a8b to 61d8dd4 Compare October 23, 2017 11:30
@zonkmachine zonkmachine merged commit f9ab2de into LMMS:stable-1.2 Oct 24, 2017
@zonkmachine zonkmachine deleted the automationpointissues branch October 24, 2017 15:42
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants