mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
33 lines
941 B
C++
33 lines
941 B
C++
#ifndef SHARED_ZOOM_CURVE_VIEW_CONTROLLER_H
|
|
#define SHARED_ZOOM_CURVE_VIEW_CONTROLLER_H
|
|
|
|
#include <escher/view_controller.h>
|
|
#include "interactive_curve_view_range.h"
|
|
#include "curve_view_cursor.h"
|
|
#include "curve_view.h"
|
|
|
|
namespace Shared {
|
|
|
|
/* ZoomCurveViewController is a View controller with a cursor that can handles
|
|
* zoom in/out events. */
|
|
|
|
class ZoomCurveViewController : public ViewController {
|
|
public:
|
|
static constexpr float k_zoomOutRatio = 3.f / 2.f;
|
|
|
|
ZoomCurveViewController(Responder * parentResponder) : ViewController(parentResponder) {}
|
|
View * view() override { return curveView(); }
|
|
bool handleEvent(Ion::Events::Event event) override;
|
|
protected:
|
|
virtual bool handleZoom(Ion::Events::Event event);
|
|
virtual InteractiveCurveViewRange * interactiveCurveViewRange() = 0;
|
|
virtual CurveView * curveView() = 0;
|
|
virtual float xFocus() = 0;
|
|
virtual float yFocus() = 0;
|
|
CurveViewCursor * m_cursor;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|