13
0

Fix meter colour gradients (mid and top were swapped).

I removed the double stop around the knee because... well, this is the way I figured out that actually follows the colour configuration as expected.  It may be less correct for some reason, but it looks like what I expect when twiddling the colours, anyway.


git-svn-id: svn://localhost/ardour2/branches/3.0@10041 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2011-08-31 17:22:05 +00:00
parent d3c38e28fc
commit c55f142ad0

View File

@ -116,14 +116,11 @@ FastMeter::generate_meter_pattern (
/* cairo coordinate space goes downwards as y value goes up, so invert
* knee-based positions by using (1.0 - y)
*
* also, double-stop the knee point, so that we get a hard transition
*/
cairo_pattern_add_color_stop_rgb (_p, 0.0, r3/255.0, g3/255.0, b3/255.0); // bottom
cairo_pattern_add_color_stop_rgb (_p, 1.0 - (knee/(2.0 * height)), r2/255.0, g2/255.0, b2/255.0); // mid-point to knee
cairo_pattern_add_color_stop_rgb (_p, 1.0 - (knee/(double)height), r0/255.0, g0/255.0, b0/255.0); // knee
cairo_pattern_add_color_stop_rgb (_p, 1.0 - (knee/(double)height), r1/255.0, g1/255.0, b1/255.0); // double-stop @ knee
cairo_pattern_add_color_stop_rgb (_p, 1.0 - (knee/(double)height), r2/255.0, g2/255.0, b2/255.0); // mid-point to knee
cairo_pattern_add_color_stop_rgb (_p, 1.0 - (knee/(2.0 * height)), r1/255.0, g1/255.0, b1/255.0); // knee to top
cairo_pattern_add_color_stop_rgb (_p, 1.0, r0/255.0, g0/255.0, b0/255.0); // top
Cairo::RefPtr<Cairo::Pattern> p (new Cairo::Pattern (_p, false));