summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-06-28 17:09:39 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-06-28 17:09:39 -0400
commitaa480b833800ad943ede17c26df3d7103f5da28d (patch)
tree75efe3618da9f42e18403a2101cf550a6127e1a0
parent5b3ebe824ed86461232e2990f0dc79dfde8b2423 (diff)
make clip indicators more visible (the smaller of 7 pixels or 5% of track height)
-rw-r--r--libs/canvas/wave_view.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/canvas/wave_view.cc b/libs/canvas/wave_view.cc
index b6d3a1c1dd..ce5c87ccfd 100644
--- a/libs/canvas/wave_view.cc
+++ b/libs/canvas/wave_view.cc
@@ -330,6 +330,11 @@ WaveView::draw_image (PeakData* _peaks, int n_peaks) const
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);
@@ -338,7 +343,7 @@ WaveView::draw_image (PeakData* _peaks, int n_peaks) const
if (show_top_clip) {
context->set_source_rgba (1.0, 0, 0, 1.0);
- context->rel_line_to (0, 2.0);
+ context->rel_line_to (0, clip_height);
context->stroke ();
context->set_source_rgba (0.0, 0, 0, 1.0);
} else {
@@ -350,7 +355,7 @@ WaveView::draw_image (PeakData* _peaks, int n_peaks) const
context->move_to (i, tips[i].bot);
if (tips[i].clip_min) {
context->set_source_rgba (1.0, 0, 0, 1.0);
- context->rel_line_to (0, -2.0);
+ context->rel_line_to (0, -clip_height);
context->stroke ();
context->set_source_rgba (0.0, 0, 0, 1.0);
} else {