Skip to content

Conversation

@keggsmurph21
Copy link
Collaborator

This patch simplifies some of the internal structure of the ZoomFrame widget towards an ultimate goal of generally refactoring our widgets.

In particular, I think we should move away from modifying internal state of classes directly, and instead rely on small functions that perform single tasks (see, for example, splitting ZoomFrame::wheel into ZoomFrame::zoom{,in,out}), as well as only maintaining the minimal amount of state that cannot be derived.

If you guys have a chance, could you take a look at this PR and just make sure it still works for you? Ultimately, we should be also moving towards a unit-testing framework, as that will enable us to make these larger refactoring changes without worrying about breaking compatibility.

This widget was overly bloated considering the things that it actually
needed to manage.  For example, we were storing several different types
of width/height, even though the only "important" ones are the widget
dimensions and the dimensions of each image.
If we tried to load an invalid TextGrid file, that would cause the
program to raise a (native) TextGrid error and crash us.
@keggsmurph21 keggsmurph21 added the help wanted Extra attention is needed label Dec 17, 2019
Copy link
Collaborator

@calebho calebho left a comment

Choose a reason for hiding this comment

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

lgtm

@jonorthwash jonorthwash force-pushed the master branch 3 times, most recently from 81d5a96 to 9d1c199 Compare October 13, 2020 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants