aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2022-11-12 16:18:41 +0100
committerThomas White <taw@physics.org>2022-11-12 16:18:41 +0100
commit33295a553400b1266bc8cd958a448aae95eb1e9e (patch)
tree0b96273c28f08a982301f2bdfcc0a565a4b4a021
parent1cf13d49b350a6aa145977885eab0629f7bfec51 (diff)
Fixture display: snap text colour at 50% intensity
There's no way around it. Either we have a snap change like this (distracting), or the intensity is invisible at some value.
-rw-r--r--src/starlet-fixture-display.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/starlet-fixture-display.c b/src/starlet-fixture-display.c
index b4fc042..5775741 100644
--- a/src/starlet-fixture-display.c
+++ b/src/starlet-fixture-display.c
@@ -168,7 +168,6 @@ static void draw_fixture(cairo_t *cr,
/* Intensity */
if ( fix->intensity >= 0.0 ) {
- const double gbw = 40.0;
char tmp[32];
double grey;
snprintf(tmp, 32, "%.0f%%", fix->intensity);
@@ -177,13 +176,10 @@ static void draw_fixture(cairo_t *cr,
pango_layout_set_height(layout, lh*PANGO_SCALE);
pango_layout_set_font_description(layout, fontdesc);
- double gbl = 50.0 - gbw / 2.0;
- if ( fix->intensity < gbl ) {
+ if ( fix->intensity < 50.0 ) {
grey = 1.0;
- } else if ( fix->intensity > 50.0 + gbw/2.0) {
- grey = 0.0;
} else {
- grey = 1.0 - (fix->intensity - gbl) / gbw;
+ grey = 0.0;
}
cairo_set_source_rgb(cr, grey, grey, grey);