Skip to content

Commit

Permalink
Fixed|UI|Client|GridLayout: Determining cell alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 20, 2013
1 parent 7aa939f commit 666dc88
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions doomsday/client/src/ui/framework/gridlayout.cpp
Expand Up @@ -25,6 +25,8 @@ using namespace de;

DENG2_PIMPL(GridLayout)
{
typedef QMap<Vector2i, ui::Alignment> CellAlignments;

WidgetList widgets;
Mode mode;
int maxCols;
Expand All @@ -37,7 +39,7 @@ DENG2_PIMPL(GridLayout)
Rule const *fixedCellWidth;
Rule const *fixedCellHeight;
QMap<int, Rule const *> fixedColWidths;
QMap<Vector2i, ui::Alignment> cellAlignment;
CellAlignments cellAlignment;
Rule const *colPad;
Rule const *rowPad;

Expand Down Expand Up @@ -268,15 +270,12 @@ DENG2_PIMPL(GridLayout)

ui::Alignment alignment(Vector2i pos) const
{
if(cellAlignment.contains(pos))
{
return cellAlignment[pos];
}
if(cols.at(pos.x)->cellAlign)
CellAlignments::const_iterator found = cellAlignment.find(pos);
if(found != cellAlignment.end())
{
return cols.at(pos.x)->cellAlign;
return found.value();
}
return ui::AlignTopLeft;
return cols.at(pos.x)->cellAlign;
}

/**
Expand Down

0 comments on commit 666dc88

Please sign in to comment.