foxygit / Torlinkc Log in
commits tags

/include/torlinkc/ui/move.hpp · 358 B

raw
#pragma once

namespace torlinkc::ui {

// Modulo-wraparound stepping for cursor movement. Ported from ui/move.ts.
int wrapStep(int current, int delta, int length);

// Scrolling-viewport start index that keeps `cursor` centered, clamped to
// bounds. Ported from ui/move.ts.
int windowStart(int cursor, int total, int height);

}  // namespace torlinkc::ui