Buttons no longer render twice

This commit is contained in:
andreja6
2020-03-09 14:48:24 -07:00
parent 7c85167030
commit 36ec6b1dc5
2 changed files with 24 additions and 10 deletions

View File

@@ -98,12 +98,7 @@ void TextButtonInstance::drawObj(RenderDevice* rd, Vector2 mousePos, bool mouseD
Draw::box(Box(point1, point2), rd, boxColorDn, boxOutlineColorDn);
font->draw2D(rd, title, RelativeTo, textSize, textColorDn, textOutlineColorDn);
}
else if(mouseInArea(point1.x, point1.y, point2.x, point2.y, mousePos.x, mousePos.y))
{
Draw::box(Box(point1, point2), rd, boxColorOvr, boxOutlineColorOvr);
font->draw2D(rd, title, RelativeTo, textSize, textColorOvr, textOutlineColorOvr);
}
else if(selected)
else if(selected || mouseInArea(point1.x, point1.y, point2.x, point2.y, mousePos.x, mousePos.y))
{
Draw::box(Box(point1, point2), rd, boxColorOvr, boxOutlineColorOvr);
font->draw2D(rd, title, RelativeTo, textSize, textColorOvr, textOutlineColorOvr);