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

Projects
None yet
1 participant
@zonkmachine
Member

zonkmachine commented Nov 21, 2017

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

Fixes #3995

@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Nov 22, 2017

Member

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

Member

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

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Nov 22, 2017

Member

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

Member

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

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Dec 5, 2017

Member

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.

Member

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.

Automation Editor - Straighten out draw line function
The function to draw a straight line the Automation Editor is glitchy.

Fixes:
  Adjust the line level.
  AutomationEditor::drawLine(..) - quantize input
@zonkmachine

This comment has been minimized.

Show comment
Hide comment
@zonkmachine

zonkmachine Dec 5, 2017

Member

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

Member

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

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