-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 point drag cancel with right click #5316
Conversation
🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩
Windows
Linux
🤖{"platform_name_to_artifacts": {"Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://7253-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.657-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/7253?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://7254-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.657-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/7254?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/ur0ywlg1o1w3c8mf/artifacts/build/lmms-1.2.2-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/34003045"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/nq0f7i66aj9db07b/artifacts/build/lmms-1.2.2-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/34003045"}], "Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://7251-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.657-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/7251?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "c2809a369252d2de7123ce852136bb46da9f4e27"} |
I think both #5315 and this works mainly by making further mouse operations no-op after certain actions. So, I'm wondering if we can somehow consolidate them partially. |
@PhysSong I believe both pull requests do not share lines, unless I lost track when checking, I only checked once. This PR uses a mouse button condition of the left button to prevent erasing with the right button while holding the left button, and this occurs without regard to other functions. #5315 uses a mouse button condition variable to disable the normal drag condition (by holding the left mouse button) after a line is drawn. Both involve the left mouse button when moving the mouse, and both are disabling operations, but for different reasons. Consolidation might be tricky. One way, and I did previously like this idea, could be to use Does that answer your question? Aside: Hmm, thinking about it now, the |
@tecknixia This PR has conflicts that needs to be resolved since #5315 was merged. |
@zonkmachine Looking at it now. Wait... you mean to tell me this whole time, #5315 and #5316 did indeed share a line of code?!? I've updated with a solution that I believe should work. |
@zonkmachine @russiankumar #5592 |
If you've decided you don't want to work on this anymore, you can close it yourself, and drop a comment on the linked issue that it's open for someone else to take. Just saying: the issue with macos is probably not related to this PR (it can't install the dependencies, I think if you rebuild it once it should work again). |
@tecknixia Fine, I'm closing this for now. Thank you for your contributions! |
Resolves #4671
This feature uses two variables to record the location of the point at the start of the drag
float m_dragStartLevel
tick_t m_dragStartTick
They are assigned the point location in
mousePressEvent
When right mouse button is clicked, and
m_action
isMOVE_VALUE
, the stored point location is sent tosetDragValue
to move the point back to it's original position, then apply dragValue is called to stop dragging.Now the cursor is over another point, and
m_action
is stillMOVE_VALUE
, and both mouse buttons are down, this condition allows dragging inmouseMoveEvent
, so we want to prevent dragging in this caseNow that we've prevented dragging, while both buttons are down, also in
mouseMoveEvent
, the condition to erase is met, so we don't want to erase a bunch of stuff on accidentFinally, in
paintEvent
, where the cursor is changed, we're not erasing, so we want to switch back to the draw tool when the drag is cancelled. That means the erase tool normally shows when the right mouse button is down, but we make an exception for whenm_action
isMOVE_VALUE
, which is true until either button is released.So, when we cancel a drag...