Skip to content

Commit fcce5d7

Browse files
committed
Cleanup
1 parent d4d7b0e commit fcce5d7

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/include/chomper/ui/countdown.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Countdown {
2222
void updateSector();
2323

2424
gsl::not_null<le::IFont*> m_font;
25-
le::TextHeight m_textHeight{120};
25+
le::TextHeight m_textHeight{};
2626

2727
le::drawable::Sector m_sector{};
2828
le::drawable::Circle m_background{};

lib/src/ui/countdown.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,19 @@ void Countdown::setTimerText(std::chrono::seconds const value) {
4646
// technically this isn't correct y-centering because parts of glyphs can be above/below the baseline,
4747
// and Text::get_size() is insufficient to adjust for that.
4848
// here, since each displayed glyph (0-9) is entirely above the baseline (unlike say 'g'),
49-
// it can be pushed down by half the size and it will "look" y-centered.
49+
// it can be pushed down by half the size and it will "look" consistently y-centered.
5050
// this is what is known as a "hack".
5151
m_text.transform.position.y = -0.5f * m_text.get_size().y;
5252
}
5353

5454
void Countdown::updateSector() {
5555
KLIB_ASSERT(m_timer > 0s);
5656
auto const ratio = m_remain / m_timer;
57-
static constexpr auto degreesBegin{90.0f};
58-
auto const degreesEnd = degreesBegin + (ratio * 360.0f);
57+
static constexpr auto degreesBegin_v{90.0f};
58+
auto const degreesEnd = degreesBegin_v + (ratio * 360.0f);
5959
auto const diameter = m_background.get_diameter() + 30.0f;
6060
auto const sectorParams = le::shape::Sector::Params{
61-
.degrees_begin = degreesBegin,
61+
.degrees_begin = degreesBegin_v,
6262
.degrees_end = degreesEnd,
6363
};
6464
m_sector.create(diameter, sectorParams);

0 commit comments

Comments
 (0)