Skip to content

Fix sensitivity of tangent editing in Automation Editor#7946

Merged
regulus79 merged 8 commits into
LMMS:masterfrom
regulus79:fix-tangent-editing
Jul 2, 2026
Merged

Fix sensitivity of tangent editing in Automation Editor#7946
regulus79 merged 8 commits into
LMMS:masterfrom
regulus79:fix-tangent-editing

Conversation

@regulus79

Copy link
Copy Markdown
Member

Previously, the sensitivity of the tangent editing in the automation editor was hardcoded so that it would change the internal value by the number of pixels the mouse moved up (with a bit of scaling based on the x position too). This is not correct, since it does not respect the zoom of the editor or the min/max values relative to the window size.

This PR adds the correct scaling constant to the tanget value to convert pixels to levels. The automation editor already had the right constant as a member variable, m_y_delta, but it would only update when using the hardcoded zoom levels, so I reworked it to also work for auto zoom.

image

@szeli1 szeli1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I did not test this PR, so I'm not approving it, but the code changes look okay.

Comment thread src/gui/editors/AutomationEditor.cpp Outdated
Comment thread src/gui/editors/AutomationEditor.cpp Outdated
@allejok96

Copy link
Copy Markdown
Contributor

Very minor issue: I noticed that the little handle still doesn't quite line up with the mouse. When dragging it in an empty not-connected automation clip, it lines up perfectly with the mouse. But on a clip connected to the volume knob I have to hold the cursor 8 pixels to the right of the dot to have it line up in the Y direction.

@regulus79

Copy link
Copy Markdown
Member Author

Very minor issue: I noticed that the little handle still doesn't quite line up with the mouse. When dragging it in an empty not-connected automation clip, it lines up perfectly with the mouse. But on a clip connected to the volume knob I have to hold the cursor 8 pixels to the right of the dot to have it line up in the Y direction.

I can also sort of reproduce this. I assume it's due to imprecisions since m_y_delta is an int. But now I've changed it to be a float, so hopefully it's fixed in the most recent commit?

@allejok96

Copy link
Copy Markdown
Contributor

Works like a charm now!

@regulus79 regulus79 added the gui label Jun 29, 2025

@messmerd messmerd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Haven't tested, but looks pretty good

resizeEvent(nullptr);
}

void AutomationEditor::updateYDelta()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not part of this PR, but just below this there's this:

const QString & zfac = m_zoomingYModel.currentText();
m_y_auto = zfac == "Auto";

The m_zoomingYModel's first item, "Auto", is not a QObject::tr() translated string, but it should be. However, if there were any translation that was not "Auto", this code here would break. This is all very finicky. I think we should be checking the current index not the current text, so:

m_y_auto = m_zoomingYModel.value() == 0; // "Auto"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice catch, also I fixed this in #7941

Comment thread src/gui/editors/AutomationEditor.cpp Outdated
Co-authored-by: Dalton Messmer <messmer.dalton@gmail.com>
@rubiefawn rubiefawn added enhancement needs testing This pull request needs more testing labels May 30, 2026
Comment thread src/gui/editors/AutomationEditor.cpp Outdated
@regulus79 regulus79 merged commit f4d5957 into LMMS:master Jul 2, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement gui needs testing This pull request needs more testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants