Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/game/client/neo/ui/neo_hud_childelement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,19 @@ CNEOHud_ChildElement::XYHudPos CNEOHud_ChildElement::DrawNeoHudRoundedCommon(
const int x0, const int y0, const int x1, const int y1, Color color,
bool topLeft, bool topRight, bool bottomLeft, bool bottomRight) const
{
const XYHudPos p{
XYHudPos p{
.x0w = x0 + m_rounded_width,
.x1w = x1 - m_rounded_width,
.y0h = y0 + m_rounded_height,
.y1h = y1 - m_rounded_height,
};

if (p.y1h < p.y0h)
p.y1h = p.y0h = y0 + (0.5 * (y1 - y0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.5 may be treated as a double, so either this could be represented with 0.5f, or you could just divide by 2.


if (p.x1w < p.x0w)
p.x1w = p.x0w = x0 + (0.5 * (x1 - x0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.5 may be treated as a double, so either this could be represented with 0.5f, or you could just divide by 2.


surface()->DrawSetColor(color);

// Rounded corner pieces
Expand Down