Made round summary scrollable (long summary texts don't overflow anymore), listbox scissorrects work correctly now on nested listboxes

This commit is contained in:
Joonas Rikkonen
2018-02-22 12:18:09 +02:00
parent 27ded3e5a3
commit 375e135672
3 changed files with 50 additions and 41 deletions
@@ -97,6 +97,9 @@ namespace Barotrauma
{
base.Rect = value;
frame.Rect = value;
scrollBar.Rect = scrollBar.IsHorizontal ?
new Rectangle(rect.X, rect.Bottom - 20, rect.Width, 20) :
new Rectangle(rect.Right - 20, rect.Y, 20, rect.Height);
}
}
@@ -408,7 +411,9 @@ namespace Barotrauma
if (!scrollBarHidden) scrollBar.Draw(spriteBatch);
Rectangle prevScissorRect = spriteBatch.GraphicsDevice.ScissorRectangle;
spriteBatch.GraphicsDevice.ScissorRectangle = frame.Rect;
spriteBatch.GraphicsDevice.ScissorRectangle = Rectangle.Intersect(prevScissorRect, frame.Rect);
int lastVisible = 0;
for (int i = 0; i < children.Count; i++)