mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-12-02 23:22:19 +00:00
Remove a lot of static_cast<>s involving UI structs.
Also starting to get religion on using unsigned integers only when I want their wrapping/modulus behavior.
This commit is contained in:
@@ -82,13 +82,10 @@ void MenuView::add_items(std::initializer_list<MenuItem> items) {
|
||||
void MenuView::set_parent_rect(const Rect new_parent_rect) {
|
||||
View::set_parent_rect(new_parent_rect);
|
||||
|
||||
constexpr size_t item_height = 24;
|
||||
size_t i = 0;
|
||||
constexpr int item_height = 24;
|
||||
int i = 0;
|
||||
for(auto child : children_) {
|
||||
child->set_parent_rect({
|
||||
{ 0, static_cast<ui::Coord>(i * item_height) },
|
||||
{ size().width(), item_height }
|
||||
});
|
||||
child->set_parent_rect({ 0, i * item_height, size().width(), item_height });
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user