mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-05-19 14:15:02 -04:00
[EGD-3336] Fixed negative SizeLeft return bug.
This commit is contained in:
committed by
PrzeBrudny
parent
e25a17b29f
commit
093e414a1d
@@ -11,8 +11,10 @@ namespace style
|
||||
constexpr uint32_t listPositionX = style::window::default_left_margin;
|
||||
// Magic 1 -> discussed with Design for proper alignment.
|
||||
constexpr uint32_t ListPositionY = style::header::height - 1;
|
||||
constexpr uint32_t listHeight = style::window_height - ListPositionY - style::footer::height;
|
||||
constexpr uint32_t listWidth = style::listview::body_width_with_scroll;
|
||||
// Bottom margin need to be added to fit all elements.
|
||||
constexpr uint32_t listHeight =
|
||||
style::window_height - ListPositionY - style::footer::height + style::margins::small;
|
||||
constexpr uint32_t listWidth = style::listview::body_width_with_scroll;
|
||||
} // namespace threads
|
||||
|
||||
namespace threadItem
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "Rect.hpp"
|
||||
#include <Alignment.hpp>
|
||||
#include "LayoutSizeStore.hpp"
|
||||
#include "log/log.hpp"
|
||||
|
||||
namespace gui
|
||||
{
|
||||
@@ -30,7 +31,7 @@ namespace gui
|
||||
};
|
||||
template <Axis axis> uint32_t sizeLeft(Item *it, Item::Area area = Item::Area::Min)
|
||||
{
|
||||
return it->getSize(axis) - sizeUsed<axis>(it);
|
||||
return (sizeUsed<axis>(it) >= it->getSize(axis)) ? 0 : it->getSize(axis) - sizeUsed<axis>(it);
|
||||
};
|
||||
|
||||
template <Axis axis> void resizeItems();
|
||||
|
||||
Reference in New Issue
Block a user