mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[sequence] Restore margins on the sequence graph
This commit is contained in:
committed by
LeaNumworks
parent
f3b770cb29
commit
316d054935
@@ -10,6 +10,7 @@ public:
|
||||
CurveViewRange(Shared::InteractiveCurveViewRangeDelegate * delegate = nullptr);
|
||||
void normalize(bool forceChangeY = false) override;
|
||||
private:
|
||||
virtual bool defaultRangeCriteria() const override { return false; }
|
||||
constexpr static float k_displayLeftMarginRatio = 0.1f;
|
||||
};
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ void InteractiveCurveViewRange::setDefault() {
|
||||
m_delegate->interestingRanges(this);
|
||||
/* If the horizontal bounds are integers, they are preset values and should
|
||||
* not be changed. */
|
||||
bool isDefaultRange = (xMin() == std::round(xMin())) && (xMax() == std::round(xMax()));
|
||||
bool isDefaultRange = defaultRangeCriteria();
|
||||
|
||||
// Add margins, then round limits.
|
||||
float newXMin = xMin(), newXMax = xMax();
|
||||
|
||||
@@ -78,6 +78,8 @@ protected:
|
||||
* 2 * 1 unit -> 10.0mm
|
||||
* So normalizedYHalfRange = 43.2mm * 170/240 * 1 unit / 10.0mm */
|
||||
constexpr static float NormalizedYHalfRange(float unit) { return 3.06f * unit; }
|
||||
virtual bool defaultRangeCriteria() const { return (xMin() == std::round(xMin())) && (xMax() == std::round(xMax())); }
|
||||
|
||||
InteractiveCurveViewRangeDelegate * m_delegate;
|
||||
private:
|
||||
float offscreenYAxis() const override { return m_offscreenYAxis; }
|
||||
|
||||
Reference in New Issue
Block a user