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

reaper.BR_GetMouseCursorContext_MIDI() noteRow_value BUG with scale>1 #1916

Open
olshalom opened this issue Jan 1, 2025 · 1 comment
Open

Comments

@olshalom
Copy link

olshalom commented Jan 1, 2025

While reaper.BR_GetMouseCursorContext_MIDI() does start to return noteRow_value ~ -1 at the correct height, it doesn't start at the correct noteRow.

The Issue appear with a scale>1 on windowsOS.
On macOS it's working correctly. No clue about Linux, sorry.

The offset stays the same, even ccLanes area get changed in height.
So it seems to me the height of the transport/grid settings bar and the scrollbar is not scaled correctly.

All other values (ccLane, ccLaneVal, ccLaneId) seem correct:

BR_GetMouseCursorContext_MIDI_noteRow_issue_150%

-- CONSOLE OUTPUT --
function Msg(param)
  reaper.ShowConsoleMsg(tostring(param).."\n")
end

function main()
  reaper.ClearConsole()
  local scale = select(2, reaper.ThemeLayout_GetLayout('tcp', -3))/256
  --Msg(scale)
  local window, segment, details = reaper.BR_GetMouseCursorContext()
  local retval, inlineEditor, noteRow, ccLane, ccLaneVal, ccLaneId = reaper.BR_GetMouseCursorContext_MIDI()
  Msg(segment)
  Msg(ccLane)
  Msg(ccLaneId)
  Msg(noteRow)

  reaper.defer(main)
end

reaper.defer(main)

I ran into the issue by debugging the super cool "Lasso for midi editor" script by Amely Suncroll:
https://forum.cockos.com/showthread.php?t=297070

Thanks for looking into the issue to satisfy all users of the script.

Best regards, Oliver

@AmelySuncroll
Copy link

AmelySuncroll commented Jan 3, 2025

I agree with that. If we have 125% scale on windowsOS then we get row offset +1 compare to 100%. If we have 150% scale then we get the row offset +2 more compare to 125% scale.

100%
100

125%
125

150%
150

Thanks for your post about this issue here.

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

No branches or pull requests

2 participants