Permalink
Browse files

Merge pull request #235 from redv/fix_listbox

fix listbox render
  • Loading branch information...
JonnyH committed Nov 3, 2017
2 parents feca4d2 + fc447c0 commit fef16d97d403414dabb2d1d3bf31a5dbc4a747ab
Showing with 16 additions and 14 deletions.
  1. +16 −14 forms/listbox.cpp
View
@@ -56,6 +56,22 @@ void ListBox::onRender()
if (ctrl != scroller && ctrl->isVisible())
{
ctrl->Location = controlOffset - this->scrollOffset;
if (ListOrientation == ScrollOrientation && ItemSize != 0)
{
switch (ScrollOrientation)
{
case Orientation::Vertical:
ctrl->Size.x = (scroller_is_internal ? scroller->Location.x : this->Size.x);
ctrl->Size.y = ItemSize;
break;
case Orientation::Horizontal:
ctrl->Size.x = ItemSize;
ctrl->Size.y = (scroller_is_internal ? scroller->Location.y : this->Size.y);
break;
}
}
switch (ListOrientation)
{
case Orientation::Vertical:
@@ -75,20 +91,6 @@ void ListBox::onRender()
}
break;
}
if (ListOrientation == ScrollOrientation && ItemSize != 0)
{
switch (ScrollOrientation)
{
case Orientation::Vertical:
ctrl->Size.x = (scroller_is_internal ? scroller->Location.x : this->Size.x);
ctrl->Size.y = ItemSize;
break;
case Orientation::Horizontal:
ctrl->Size.x = ItemSize;
ctrl->Size.y = (scroller_is_internal ? scroller->Location.y : this->Size.y);
break;
}
}
}
}

0 comments on commit fef16d9

Please sign in to comment.