Merge pull request #558 from Areloch/MiscFixes20210901

Misc Fixes and QOL improvements
This commit is contained in:
Brian Roberts 2021-09-01 17:38:24 -05:00 committed by GitHub
commit 09492f0885
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 341 additions and 217 deletions

View file

@ -881,6 +881,12 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
// Do we render a bitmap border or lines?
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
{
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
{
//if our bitmap is smaller than the height of our ctrl, we'll nudge it towards the center
U32 nudge = (baseRect.extent.y - mProfile->mBitmapArrayRects[0].extent.y) / 2;
baseRect.point.y += nudge;
}
// Render the fixed, filled in border
renderFixedBitmapBordersFilled(baseRect, 3, mProfile );
@ -926,6 +932,12 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
// Do we render a bitmap border or lines?
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
{
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
{
//if our bitmap is smaller than the height of our ctrl, we'll nudge it towards the center
U32 nudge = (baseRect.extent.y - mProfile->mBitmapArrayRects[0].extent.y) / 2;
baseRect.point.y += nudge;
}
// Render the fixed, filled in border
renderFixedBitmapBordersFilled(baseRect, 2, mProfile );
@ -957,6 +969,12 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
// Do we render a bitmap border or lines?
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
{
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
{
//if our bitmap is smaller than the height of our ctrl, we'll nudge it towards the center
U32 nudge = (baseRect.extent.y - mProfile->mBitmapArrayRects[0].extent.y) / 2;
baseRect.point.y += nudge;
}
// Render the fixed, filled in border
renderFixedBitmapBordersFilled(baseRect, 1, mProfile );
}
@ -976,6 +994,12 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
// Do we render a bitmap border or lines?
if ( !( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) )
{
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
{
//if our bitmap is smaller than the height of our ctrl, we'll nudge it towards the center
U32 nudge = (baseRect.extent.y - mProfile->mBitmapArrayRects[0].extent.y) / 2;
baseRect.point.y += nudge;
}
drawUtil->drawRect( baseRect, mProfile->mBorderColorNA );
}
}
@ -1095,6 +1119,13 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
// If we're rendering a bitmap border, then it will take care of the arrow.
if ( !(mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size()) )
{
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
{
//if our bitmap is smaller than the height of our ctrl, we'll nudge it towards the center
U32 nudge = (baseRect.extent.y - mProfile->mBitmapArrayRects[0].extent.y) / 2;
baseRect.point.y += nudge;
}
// Draw a triangle (down arrow)
S32 left = baseRect.point.x + baseRect.extent.x - 12;
S32 right = left + 8;