From 1838a9d6cf463ace1c1d50b27a96139e3586a9b8 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Sat, 31 Oct 2020 00:50:54 +0100 Subject: [PATCH] less fps, integer display of values, switched to Hack font for stable display --- huey/Huey.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/huey/Huey.cpp b/huey/Huey.cpp index 45bee3f..256967d 100644 --- a/huey/Huey.cpp +++ b/huey/Huey.cpp @@ -29,7 +29,7 @@ ScreensaverPlugin* create_instance() { } int Huey::fps() const { - return 40; + return 5; } void Huey::draw_frame() { @@ -50,13 +50,13 @@ void Huey::draw_frame() { // show hue value std::ostringstream hue_oss; - hue_oss << "hue: " << std::setw(5) << std::setprecision(4) << _hue; + hue_oss << "hue: " << std::setw(3) << static_cast(_hue); std::ostringstream rgb_oss; rgb_oss << "red: " << std::setw(3) << static_cast(255 * rgb.r); rgb_oss << ", green: " << std::setw(3) << static_cast(255 * rgb.g); rgb_oss << ", blue: " << std::setw(3) << static_cast(255 * rgb.b); cairo_set_source_rgb(_c, 0, 0, 0); - cairo_select_font_face(_c, "Helvetica", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); + cairo_select_font_face(_c, "Hack", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size(_c, 24); cairo_move_to(_c, 31, 51); cairo_show_text(_c, hue_oss.str().c_str()); @@ -69,7 +69,7 @@ void Huey::draw_frame() { cairo_show_text(_c, rgb_oss.str().c_str()); // update for next frame - _hue += 0.1; + _hue += 0.5; if (_hue >= 360.0) { _hue -= 360.0; }