mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-28 16:29:34 +08:00
Add clang-tidy. (#368)
This commit is contained in:
@@ -21,27 +21,29 @@ Element vscroll_indicator(Element child) {
|
||||
using NodeDecorator::NodeDecorator;
|
||||
|
||||
void ComputeRequirement() override {
|
||||
Node::ComputeRequirement();
|
||||
NodeDecorator::ComputeRequirement();
|
||||
requirement_ = children_[0]->requirement();
|
||||
requirement_.min_x++;
|
||||
}
|
||||
|
||||
void SetBox(Box box) override {
|
||||
Node::SetBox(box);
|
||||
if (box_.x_min > box_.x_max)
|
||||
NodeDecorator::SetBox(box);
|
||||
if (box_.x_min > box_.x_max) {
|
||||
box_.x_max--;
|
||||
}
|
||||
children_[0]->SetBox(box);
|
||||
}
|
||||
|
||||
void Render(Screen& screen) final {
|
||||
Node::Render(screen);
|
||||
NodeDecorator::Render(screen);
|
||||
|
||||
const Box& stencil = screen.stencil;
|
||||
|
||||
int size_inner = box_.y_max - box_.y_min;
|
||||
int size_outter = stencil.y_max - stencil.y_min + 1;
|
||||
if (size_outter >= size_inner)
|
||||
if (size_outter >= size_inner) {
|
||||
return;
|
||||
}
|
||||
|
||||
int size = 2 * size_outter * size_outter / size_inner;
|
||||
size = std::max(size, 1);
|
||||
@@ -56,7 +58,7 @@ Element vscroll_indicator(Element child) {
|
||||
bool up = (start_y <= y_up) && (y_up <= start_y + size);
|
||||
bool down = (start_y <= y_down) && (y_down <= start_y + size);
|
||||
|
||||
const char* c = up ? (down ? "┃" : "╹") : (down ? "╻" : " ");
|
||||
const char* c = up ? (down ? "┃" : "╹") : (down ? "╻" : " "); // NOLINT
|
||||
screen.PixelAt(x, y) = Pixel();
|
||||
screen.PixelAt(x, y).character = c;
|
||||
}
|
||||
|
Reference in New Issue
Block a user