SDRPlusPlus
SDRPlusPlus copied to clipboard
Move exponential zoom logic to WaterFall::setZoom
WaterFall::setZoom is declared in waterfall.h, but wasn't implemented.
I'm doing this in preparation of another PR.
It's not the waterfall's job to handle the zoom controls, hence why it was never implemented.
I'd rather delete the declaration instead
I thought about that, but where else to put it? Is this more acceptable?
I want to implement scrolling with Ctrl+mwheel, as requested in #608, but I don't wanna duplicate the zoom algorithm.
EDIT: But then I'd be moving code better suited for the Waterfall class into main_window.cpp... I think that just going with the original commit is the lesser evil. It's 10 lines of code and only touches the waterfall, nothing else. EDIT2: Yes, having it in the waterfall class is 100 % more convenient. It's a small helper function directly related to the waterfall.
You're forgetting that the zoom slider is supposed to update when the zoom is changed. That's why the zoom code is not part of the waterfall. By the way, I'm not currently accepting feature pull requests since I don't have the time to validate the code. Moreover quite a bit of the code is currently changing for the android UI compatibility.
I know, I realized. Forgive me for the abomination I have brought into this world. Check out the code now.
This is the most convenient (for future development) way that came to mind. And it's not terrible. Or maybe it is. I don't know... I'm keeping it in my fork, it works fine. Some way to decouple the logic between WaterFall and MainWindow should be found.
setZoom still isn't implemented: https://github.com/AlexandreRouma/SDRPlusPlus/blob/50a77a7e608d59cdf1633f223b6900c8e51da351/core/src/gui/widgets/waterfall.h#L147