Borders typically did not take opacity into account since recent optimization

0.8
Bruno Van de Velde 2017-02-10 00:32:46 +01:00
parent 5e3fb427a0
commit 2e3cc753f0
1 changed files with 3 additions and 1 deletions

View File

@ -765,11 +765,13 @@ namespace tgui
sf::Vector2f size,
sf::Color color) const
{
color = Color::calcColorOpacity(color, m_opacityCached);
// If size is too small then draw entire size as border
if ((size.x <= borders.left + borders.right) || (size.y <= borders.top + borders.bottom))
{
sf::RectangleShape border;
border.setFillColor(Color::calcColorOpacity(color, m_opacityCached));
border.setFillColor(color);
border.setSize({size.x, size.y});
target.draw(border, states);
}