- double max_angle = 0.0;
- double min_angle = DBL_MAX;
-
- for (Targets::iterator i = pucks.begin(); i != pucks.end(); ++i) {
- max_angle = max ((*i)->position.azi, max_angle);
- min_angle = min ((*i)->position.azi, min_angle);
- }
-
- /* if the angle between the max & min is bigger than 180, flip
- them to use the opposite angle for the display. this
- matches the psycho-acoustic perception of this condition
- too, in almost all conditions that VBAP will handle.
- */
-
- if (fabs (max_angle - min_angle) > 180.0) {
- swap (max_angle, min_angle);
- }
-
- /* convert to radians */
-
- min_angle = (min_angle / 360.0) * 2.0 * M_PI;
- max_angle = (max_angle / 360.0) * 2.0 * M_PI;
-
- /* cairo has coordinates increasing in a clockwise direction */
-
- max_angle = (2 * M_PI) - max_angle;
- min_angle = (2 * M_PI) - min_angle;
-
- /* the above transformation will have reversed the min/max relationship */
-
- swap (min_angle, max_angle);
-
- if (min_angle > max_angle) {
- /* swapped because they span the zero position: draw two arc segments to span zero.
- XXX there must be a way to get cairo to do this in a single call
- */
- cairo_arc_negative (cr, width/2, height/2, dimen/2.0, max_angle, 0.0);
- cairo_arc_negative (cr, width/2, height/2, dimen/2.0, 0.0, min_angle);
+ cairo_save (cr);
+ cairo_translate (cr, radius, radius);
+ cairo_rotate (cr, position_angle - (width_angle/2.0));
+ cairo_move_to (cr, 0, 0);
+ cairo_arc_negative (cr, 0, 0, radius, width_angle, 0.0);
+ cairo_close_path (cr);
+ if (panner->pannable()->pan_width_control->get_value() >= 0.0) {
+ /* normal width */
+ cairo_set_source_rgba (cr, 0.282, 0.517, 0.662, 0.45);