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

Automation Editor - Straighten out draw line function #3997

Merged
merged 1 commit into from Dec 6, 2017

Conversation

@zonkmachine
Copy link
Member

@zonkmachine zonkmachine commented Nov 21, 2017

Nudge the line (biggest improvement) and quantize x arguments to AutomationEditor::drawLine(..).

Fixes #3995

@zonkmachine
Copy link
Member Author

@zonkmachine zonkmachine commented Nov 22, 2017

This isn't one issue only. I've fixed up AutomationEditor::drawLine(...) but there is still things to do.
In AutomationEditor::mousePressEvent(...), if the shift button is held and the left mouse button is pressed, we first draw a line and then carry on with the final point and create a drag value as the last point is selected for dragging. The magic happens here. Many times it's the last or next to last point that is off so I think this is related to a rounding off error and/or quantization in the above mentioned functions and in AutomationPattern::setDragValue(...). If you draw your points close to their quantized values there is little risk of a draw error. If you draw a line with steep angles between two points and aim for slightly to the left of the left point and to the right of the right one (picture), you will get a draw error. The closest points on both sides will snap to the same level. Setting m_drawLastTick = new_time; after it = time_map.find( new_time ); avoids this but just pushes the error around.

Edit: this specific behaviour was introduced in this PR This part reverted, issue fixed.
drawerror

@zonkmachine
Copy link
Member Author

@zonkmachine zonkmachine commented Nov 22, 2017

I think it's out of scope for 1.2 to fix this and suggest that we merge #3997 and leave #3995 open.

@zonkmachine
Copy link
Member Author

@zonkmachine zonkmachine commented Dec 5, 2017

Quantize drawline() input. The line is drawn from a mix of unquantized x0, x1 input values and the quantized deltax, and will sometimes not draw correct.

@zonkmachine zonkmachine force-pushed the zonkmachine:drawstraightline branch from 81ab877 to e3ba959 Dec 5, 2017
The function to draw a straight line the Automation Editor is glitchy.

Fixes:
  Adjust the line level.
  AutomationEditor::drawLine(..) - quantize input
@zonkmachine zonkmachine force-pushed the zonkmachine:drawstraightline branch from e3ba959 to 6315f88 Dec 5, 2017
@zonkmachine
Copy link
Member Author

@zonkmachine zonkmachine commented Dec 5, 2017

Fixed. I'll merge this tomorrow if there are no objections.

@zonkmachine zonkmachine merged commit 06c40fc into LMMS:stable-1.2 Dec 6, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@zonkmachine zonkmachine deleted the zonkmachine:drawstraightline branch Dec 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.