summaryrefslogtreecommitdiff
path: root/plugingui/layout.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2020-03-07 14:22:56 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2020-03-07 19:23:26 +0100
commitd9d7188ad7b22e8991a9ef685840ac0e88566b39 (patch)
tree23ac163bfb60cce4b9aefb658df5322687db1dc6 /plugingui/layout.cc
parentdf71bccf9c4731af9bcca79eee8d95651646bd82 (diff)
Use vector for PixelBuffer memory allocation. Use optimized render routines in some more painter algorithms. Fix capitalization of Canvas::getPixelBuffer method.
Diffstat (limited to 'plugingui/layout.cc')
-rw-r--r--plugingui/layout.cc26
1 files changed, 16 insertions, 10 deletions
diff --git a/plugingui/layout.cc b/plugingui/layout.cc
index f38bc20..61e4f77 100644
--- a/plugingui/layout.cc
+++ b/plugingui/layout.cc
@@ -33,7 +33,8 @@
namespace GUI
{
-LayoutItem::LayoutItem() : parent(nullptr)
+LayoutItem::LayoutItem()
+ : parent(nullptr)
{
}
@@ -170,7 +171,8 @@ void VBoxLayout::setHAlignment(HAlignment alignment)
//
HBoxLayout::HBoxLayout(LayoutItem* parent)
- : BoxLayout(parent), align(VAlignment::center)
+ : BoxLayout(parent)
+ , align(VAlignment::center)
{
}
@@ -242,10 +244,10 @@ void HBoxLayout::setVAlignment(VAlignment alignment)
//
GridLayout::GridLayout(LayoutItem* parent, std::size_t number_of_columns,
- std::size_t number_of_rows)
- : BoxLayout(parent)
- , number_of_columns(number_of_columns)
- , number_of_rows(number_of_rows)
+ std::size_t number_of_rows)
+ : BoxLayout(parent)
+ , number_of_columns(number_of_columns)
+ , number_of_rows(number_of_rows)
{
}
@@ -297,9 +299,11 @@ int GridLayout::lastUsedRow(int column) const
{
int last_row = -1;
- for (auto const& grid_range : grid_ranges) {
+ for (auto const& grid_range : grid_ranges)
+ {
auto const& range = grid_range.second;
- if (column >= range.column_begin && column < range.column_end) {
+ if (column >= range.column_begin && column < range.column_end)
+ {
last_row = std::max(last_row, range.row_end - 1);
}
}
@@ -311,9 +315,11 @@ int GridLayout::lastUsedColumn(int row) const
{
int last_column = -1;
- for (auto const& grid_range : grid_ranges) {
+ for (auto const& grid_range : grid_ranges)
+ {
auto const& range = grid_range.second;
- if (row >= range.row_begin && row < range.row_end) {
+ if (row >= range.row_begin && row < range.row_end)
+ {
last_column = std::max(last_column, range.column_end - 1);
}
}