aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index f33fb55..aae5b72 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -55,6 +55,14 @@ constexpr word_t clamp_to_width(long double value, long double min,
return WIDTH / (max - min) * (value - min);
}
+void draw_fraction(Fraction f, word_t x, word_t y)
+{
+ std::string s{to_string(f)};
+ // Centered at (x, y)
+ int width = MeasureText(s.c_str(), FONT_SIZE);
+ DrawText(s.c_str(), x - width / 2, y - FONT_SIZE, FONT_SIZE, WHITE);
+}
+
int main(void)
{
// NodeAllocator allocator{256};