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

Add support for TCP/MCP track spacers when acquiring context/track from mouse position #1787

Merged
merged 1 commit into from Feb 8, 2024

Conversation

jeremybernstein
Copy link
Contributor

GetTrackHeight return value includes spacer height.

Issue #1761

@AppVeyorBot

This comment was marked as outdated.

@AppVeyorBot

This comment was marked as outdated.

Copy link
Collaborator

@cfillion cfillion left a comment

Choose a reason for hiding this comment

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

Looking good! MCP and TCP seems to work perfectly.

Arrange view is incorrect if the first track has a spacer (and the master track is hidden). TranslatePointToArrangeScrollY's 0 point gets offset by one spacer size by CF_GetScrollInfo.

diff --git a/cfillion/cfillion.cpp b/cfillion/cfillion.cpp
index a6f77d93..f409efd8 100644
--- a/cfillion/cfillion.cpp
+++ b/cfillion/cfillion.cpp
@@ -479,6 +479,7 @@ BOOL CF_GetScrollInfo(HWND hwnd, const int bar, LPSCROLLINFO si)
       MediaTrack *track { CSurf_TrackFromID(i, false) };
       if(TcpVis(track)) {
         si->nPos = -static_cast<int>(GetMediaTrackInfo_Value(track, "I_TCPY"));
+        si->nPos += GetTrackSpacerSize(track);
         si->fMask &= ~SIF_POS;
         break;
       }

Breeder/BR_Util.cpp Outdated Show resolved Hide resolved
Breeder/BR_Util.h Outdated Show resolved Hide resolved
Breeder/BR_MouseUtil.cpp Outdated Show resolved Hide resolved
Breeder/BR_Util.cpp Outdated Show resolved Hide resolved
Breeder/BR_Util.cpp Outdated Show resolved Hide resolved
Breeder/BR_MouseUtil.cpp Outdated Show resolved Hide resolved
@AppVeyorBot

This comment was marked as outdated.

Copy link
Collaborator

@cfillion cfillion left a comment

Choose a reason for hiding this comment

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

Looks good to me and seems to work well. Could you squash the commits?

@jeremybernstein
Copy link
Contributor Author

@cfillion done.

@highvoltaged
Copy link

highvoltaged commented Feb 8, 2024

Testing the SWS beta bulid.

This action is not working properly:
SWS/wol: Adjust envelope or track height under mouse cursor, zoom center to mouse cursor (MIDI CC relative/mousewheel)

If i want to resize a track that is just below a track spacer, it only increases the track height with mousewheel up, but with mousewheel down, it also tries to increase the height in minimal steps, and after it gets resized i can't even get back to normal size, even with built in commands like: View: Toggle track zoom to minimum height

It works correctly if i assign a Midi CC, it only has this error with mousewheel down.

@jeremybernstein
Copy link
Contributor Author

Testing the SWS beta bulid.

This action is not working properly: SWS/wol: Adjust envelope or track height under mouse cursor, zoom center to mouse cursor (MIDI CC relative/mousewheel)

If i want to resize a track that is just below a track spacer, it only increases the track height with mousewheel up, but with mousewheel down, it also tries to increase the height in minimal steps, and after it gets resized i can't even get back to normal size, even with built in commands like: View: Toggle track zoom to minimum height

It works correctly if i assign a Midi CC, it only has this error with mousewheel down.

I am seeing issues with this action with or without track spacers. We can look into it, thanks for the report.

cfillion pushed a commit to jeremybernstein/sws that referenced this pull request Feb 13, 2024
- SWS/wol: Adjust selected envelope or last touched track height
- SWS/wol: Adjust envelope or track height under mouse cursor

reaper-oss#1787 (comment)

Add GetTrackHeightWithSpacer()

GetTrackHeight() is now balanced to SetTrackHeight(), as previously -- it will get the 'content' portion height and offset of the track in the TCP. If you need the true track offset (- spacerSize) or height (+ spacerSize), use GetTrackHeightAndOffsetWithSpacers().

Updated a couple of Zoom.cpp functions to take the spacer size into account, missed on the first pass.
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.

New Reaper track spacers cause issues with SWS mouse dependent features
4 participants