Files
Upsilon/apps/shared/interactive_curve_view_range_delegate.h
Gabriel Ozouf 17f39e5e39 [apps/graph] Take cursor into account for Y range
Additional checks have been added to ensure that the first move of the
cursor from the center of the graph would not cause the window to pan up
or down.

Change-Id: I44d7e86223941076cbf03db7a221e9c0427a64e4
2020-11-04 15:30:53 +01:00

30 lines
860 B
C++

#ifndef SHARED_INTERACTIVE_CURVE_VIEW_DELEGATE_H
#define SHARED_INTERACTIVE_CURVE_VIEW_DELEGATE_H
#include <assert.h>
namespace Shared {
class InteractiveCurveViewRange;
class InteractiveCurveViewRangeDelegate {
public:
bool didChangeRange(InteractiveCurveViewRange * interactiveCurveViewRange);
virtual float interestingXMin() const { return -interestingXHalfRange(); }
virtual float interestingXHalfRange() const { return 10.0f; }
virtual bool defaultRangeIsNormalized() const { return false; }
virtual void interestingRanges(InteractiveCurveViewRange * range) const { assert(false); }
virtual float addMargin(float x, float range, bool isVertical, bool isMin) = 0;
protected:
struct Range {
float min;
float max;
};
private:
virtual Range computeYRange(InteractiveCurveViewRange * interactiveCurveViewRange) = 0;
};
}
#endif