aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/eg-scope.lv2
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2025-02-10 15:27:55 -0500
committerDavid Robillard <d@drobilla.net>2025-02-10 15:47:54 -0500
commit4285fab0c0b14cbbcf9ddbe29d274c0c55a04edd (patch)
treebbb72e2cf7df6072f4fed15b140a0e6c5b8af7a5 /plugins/eg-scope.lv2
parent3e1e609d89fb1954bd497ae8021a3b6c0aad31f6 (diff)
downloadlv2-4285fab0c0b14cbbcf9ddbe29d274c0c55a04edd.tar.xz
Fully parenthesize expressionsHEADmain
Diffstat (limited to 'plugins/eg-scope.lv2')
-rw-r--r--plugins/eg-scope.lv2/examploscope_ui.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/eg-scope.lv2/examploscope_ui.c b/plugins/eg-scope.lv2/examploscope_ui.c
index 2ad42dc..50b8f4c 100644
--- a/plugins/eg-scope.lv2/examploscope_ui.c
+++ b/plugins/eg-scope.lv2/examploscope_ui.c
@@ -220,10 +220,10 @@ on_expose_event(GtkWidget* widget, GdkEventExpose* ev, gpointer data)
* - (DAHEIGHT / 2) * (VAL) * (GAIN)
* )
*/
- const float chn_y_offset = DAHEIGHT * c + DAHEIGHT * 0.5f - 0.5f;
- const float chn_y_scale = DAHEIGHT * 0.5f * gain;
+ const float chn_y_offset = (DAHEIGHT * c) + (DAHEIGHT * 0.5f) - 0.5f;
+ const float chn_y_scale = (DAHEIGHT * 0.5f) * gain;
-#define CYPOS(VAL) (chn_y_offset - (VAL) * chn_y_scale)
+#define CYPOS(VAL) (chn_y_offset - ((VAL) * chn_y_scale))
cairo_save(cr);
@@ -293,15 +293,15 @@ on_expose_event(GtkWidget* widget, GdkEventExpose* ev, gpointer data)
// Channel separator
if (c > 0) {
cairo_set_source_rgba(cr, .5, .5, .5, 1.0);
- cairo_move_to(cr, 0, DAHEIGHT * c - .5);
- cairo_line_to(cr, DAWIDTH, DAHEIGHT * c - .5);
+ cairo_move_to(cr, 0, (DAHEIGHT * c) - .5);
+ cairo_line_to(cr, DAWIDTH, (DAHEIGHT * c) - .5);
cairo_stroke(cr);
}
// Zero scale line
cairo_set_source_rgba(cr, .3, .3, .7, .5);
- cairo_move_to(cr, 0, DAHEIGHT * (c + .5) - .5);
- cairo_line_to(cr, DAWIDTH, DAHEIGHT * (c + .5) - .5);
+ cairo_move_to(cr, 0, (DAHEIGHT * (c + .5)) - .5);
+ cairo_line_to(cr, DAWIDTH, (DAHEIGHT * (c + .5)) - .5);
cairo_stroke(cr);
}