mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[apps] Factorize scrolling speed for long repetition
Change-Id: I5fcfaf04e418942664641c4b1cd044cda7f5aebb
This commit is contained in:
committed by
Émilie Feral
parent
241a217f58
commit
b60c67ff88
@@ -79,13 +79,13 @@ bool GraphController::handleEnter() {
|
||||
return FunctionGraphController::handleEnter();
|
||||
}
|
||||
|
||||
bool GraphController::moveCursorHorizontally(int direction, bool fast) {
|
||||
bool GraphController::moveCursorHorizontally(int direction, int scrollSpeed) {
|
||||
double xCursorPosition = std::round(m_cursor->x());
|
||||
if (direction < 0 && xCursorPosition <= 0) {
|
||||
return false;
|
||||
}
|
||||
// The cursor moves by step that is larger than 1 and than a pixel's width.
|
||||
const int step = std::ceil(m_view.pixelWidth()) * (fast ? 5 : 1);
|
||||
const int step = std::ceil(m_view.pixelWidth()) * scrollSpeed;
|
||||
double x = direction > 0 ? xCursorPosition + step:
|
||||
xCursorPosition - step;
|
||||
if (x < 0.0) {
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
private:
|
||||
Shared::XYBannerView * bannerView() override { return &m_bannerView; }
|
||||
bool handleEnter() override;
|
||||
bool moveCursorHorizontally(int direction, bool fast = false) override;
|
||||
bool moveCursorHorizontally(int direction, int scrollSpeed = 1) override;
|
||||
double defaultCursorT(Ion::Storage::Record record) override;
|
||||
CurveViewRange * interactiveCurveViewRange() override { return m_graphRange; }
|
||||
SequenceStore * functionStore() const override { return static_cast<SequenceStore *>(Shared::FunctionGraphController::functionStore()); }
|
||||
|
||||
Reference in New Issue
Block a user