Execute clang tidy and IWYU (#528)

This commit is contained in:
Arthur Sonzogni
2022-12-19 18:51:25 +01:00
committed by ArthurSonzogni
parent 4dc1a9fff9
commit 0542227ba7
55 changed files with 315 additions and 298 deletions

View File

@@ -102,9 +102,9 @@ class Frame : public Node {
Box children_box = box;
if (x_frame_) {
int external_dimx = box.x_max - box.x_min;
int internal_dimx = std::max(requirement_.min_x, external_dimx);
int focused_dimx = selected_box.x_max - selected_box.x_min;
const int external_dimx = box.x_max - box.x_min;
const int internal_dimx = std::max(requirement_.min_x, external_dimx);
const int focused_dimx = selected_box.x_max - selected_box.x_min;
int dx = selected_box.x_min - external_dimx / 2 + focused_dimx / 2;
dx = std::max(0, std::min(internal_dimx - external_dimx - 1, dx));
children_box.x_min = box.x_min - dx;
@@ -112,9 +112,9 @@ class Frame : public Node {
}
if (y_frame_) {
int external_dimy = box.y_max - box.y_min;
int internal_dimy = std::max(requirement_.min_y, external_dimy);
int focused_dimy = selected_box.y_max - selected_box.y_min;
const int external_dimy = box.y_max - box.y_min;
const int internal_dimy = std::max(requirement_.min_y, external_dimy);
const int focused_dimy = selected_box.y_max - selected_box.y_min;
int dy = selected_box.y_min - external_dimy / 2 + focused_dimy / 2;
dy = std::max(0, std::min(internal_dimy - external_dimy - 1, dy));
children_box.y_min = box.y_min - dy;
@@ -125,8 +125,8 @@ class Frame : public Node {
}
void Render(Screen& screen) override {
AutoReset<Box> stencil(&screen.stencil,
Box::Intersection(box_, screen.stencil));
const AutoReset<Box> stencil(&screen.stencil,
Box::Intersection(box_, screen.stencil));
children_[0]->Render(screen);
}