From ff83cfac10939ceba524c93d4e36f634f4bec805 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 19 May 2017 19:09:17 +0200 Subject: Make sure we don't resize to negative values. --- plugingui/layout.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugingui/layout.cc') diff --git a/plugingui/layout.cc b/plugingui/layout.cc index ea025bd..1e18c40 100644 --- a/plugingui/layout.cc +++ b/plugingui/layout.cc @@ -106,7 +106,8 @@ void BoxLayout::setSpacing(size_t spacing) // VBoxLayout::VBoxLayout(LayoutItem* parent) - : BoxLayout(parent), align(HAlignment::center) + : BoxLayout(parent) + , align(HAlignment::center) { } @@ -315,7 +316,7 @@ auto GridLayout::calculateCellSize() const -> CellSize } void GridLayout::moveAndResize( - LayoutItem& item, GridRange const& range, CellSize cell_size) const + LayoutItem& item, GridRange const& range, CellSize cell_size) const { std::size_t x = range.column_begin * (cell_size.width + spacing); std::size_t y = range.row_begin * (cell_size.height + spacing); -- cgit v1.2.3