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

Instrument edit history vZoom/vScroll issue #2179

Open
tildearrow opened this issue Sep 29, 2024 · 0 comments
Open

Instrument edit history vZoom/vScroll issue #2179

tildearrow opened this issue Sep 29, 2024 · 0 comments
Labels
bug Something isn't working GUI issues with the user interface

Comments

@tildearrow
Copy link
Owner

From #2139

Medium-ish severity (you lose your current undo/redo history when trying to undo past opening a previously unopened macro tab).

Description

Previously, when opening a previously unopened macro tab, all vZoom/vScroll values would automatically get reset from their initial -1 to reasonable values, leading to an undo state being created, which clears redo history. If you would try to undo this, it would revert to -1, leading their values to get reset again, creating an undo step again -- so effectively, opening a previously unopened macro tab cleared your redo history and you could not undo beyond it.

For the fix, my thinking was that vZoom/vScroll should get set up when the instrument is created, rather than remaining -1 until tab opened, so that all these spurious data changes don't happen at all. To get the proper starting values we need data that insEdit previously set up by building a "macroList" of FurnaceGUIMacroDesc in various spots in the code. So the bulk of the refactor is pulling out building the macroList into isolated functions, so that they can be called as part of initializing vZoom/vScroll.

Caveats

Would be very open to ideas for simpler ways to address the issue!

  • Initializing vZoom/vScroll is a FurnaceGUI operation because it currently relies on FurnaceGUIMacroDesc -- a refactor could go further and pull out the parts that are required for setting up vZoom/vScroll? It's weird that vZoom/vScroll are in DivInstrument (an engine struct) to begin with.
  • Is there a bigger macro refactor coming? I saw saw reference to it -- if so this is maybe premature.
  • It's a lot of shuffling code around so I wouldn't be surprised if something subtle broke.

(When testing/messing with with instrument edit undo, please use the history table provided in the Help->Debug window, it shows patch info for the undo/redo queues.)

@tildearrow tildearrow added bug Something isn't working GUI issues with the user interface labels Sep 29, 2024
@tildearrow tildearrow changed the title Instrument edit history vZoom/vScrol issue Instrument edit history vZoom/vScroll issue Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GUI issues with the user interface
Projects
None yet
Development

No branches or pull requests

1 participant