[apps/shared] In go to parameter controller, center window at the same

time, the cursor is changed

Change-Id: Ieece94131d0bf319078d36fcfe66c2bb58d0279d
This commit is contained in:
Émilie Feral
2017-05-30 10:31:47 +02:00
parent 3af8c86504
commit adf806c628
4 changed files with 6 additions and 4 deletions

View File

@@ -65,6 +65,8 @@ bool GoToParameterController::setParameterAtIndex(int parameterIndex, float f) {
} else {
m_cursor->moveTo(x, f);
}
m_graphRange->centerAxisAround(CurveViewRange::Axis::X, m_cursor->x());
m_graphRange->centerAxisAround(CurveViewRange::Axis::Y, m_cursor->y());
return true;
}

View File

@@ -32,6 +32,8 @@ bool FunctionGoToParameterController::setParameterAtIndex(int parameterIndex, fl
return false;
}
m_cursor->moveTo(f, y);
m_graphRange->centerAxisAround(CurveViewRange::Axis::X, m_cursor->x());
m_graphRange->centerAxisAround(CurveViewRange::Axis::Y, m_cursor->y());
return true;
}

View File

@@ -7,8 +7,8 @@ namespace Shared {
GoToParameterController::GoToParameterController(Responder * parentResponder, InteractiveCurveViewRange * graphRange, CurveViewCursor * cursor, I18n::Message symbol) :
FloatParameterController(parentResponder),
m_cursor(cursor),
m_abscisseCell(nullptr),
m_graphRange(graphRange),
m_abscisseCell(nullptr),
m_abscissaSymbol(symbol)
{
}
@@ -27,8 +27,6 @@ int GoToParameterController::reusableParameterCellCount(int type) {
}
void GoToParameterController::buttonAction() {
m_graphRange->centerAxisAround(CurveViewRange::Axis::X, m_cursor->x());
m_graphRange->centerAxisAround(CurveViewRange::Axis::Y, m_cursor->y());
StackViewController * stack = (StackViewController *)parentResponder();
stack->pop();
stack->pop();

View File

@@ -15,6 +15,7 @@ public:
protected:
constexpr static float k_maxDisplayableFloat = 1E8f;
CurveViewCursor * m_cursor;
InteractiveCurveViewRange * m_graphRange;
private:
void buttonAction() override;
HighlightCell * reusableParameterCell(int index, int type) override;
@@ -23,7 +24,6 @@ private:
void unloadView(View * view) override;
char m_draftTextBuffer[MessageTableCellWithEditableText::k_bufferLength];
MessageTableCellWithEditableText * m_abscisseCell;
InteractiveCurveViewRange * m_graphRange;
I18n::Message m_abscissaSymbol;
};