- context->set_source_rgba (0, 0, 0, 1.0);
-
- for (int i = 0; i < n_peaks; ++i) {
- context->move_to (i, tips[i].top);
-
- bool show_top_clip = (_shape == WaveView::Rectified && (tips[i].clip_max || tips[i].clip_min)) ||
- tips[i].clip_max;
-
- if (show_top_clip) {
- context->set_source_rgba (1.0, 0, 0, 1.0);
- context->rel_line_to (0, 2.0);
- context->stroke ();
- context->set_source_rgba (0.0, 0, 0, 1.0);
- } else {
- context->rel_line_to (0, 1.0);
- context->stroke ();
- }
-
- if (_shape != WaveView::Rectified) {
- context->move_to (i, tips[i].bot);
- if (tips[i].clip_min) {
+ if (_global_show_waveform_clipping) {
+
+ context->set_source_rgba (0, 0, 0, 1.0);
+
+ /* the height of the clip-indicator should be at most 7 pixels,
+ or 5% of the height of the waveview item.
+ */
+ const double clip_height = min (7.0, ceil (_height * 0.05));
+
+ for (int i = 0; i < n_peaks; ++i) {
+ context->move_to (i, tips[i].top);
+
+ bool show_top_clip = (_shape == WaveView::Rectified && (tips[i].clip_max || tips[i].clip_min)) ||
+ tips[i].clip_max;
+
+ if (show_top_clip) {