+
+ if (ds < FADER_RESERVE) {
+ ds = FADER_RESERVE;
+ }
+ assert(ds <= w);
+
+ /*
+ * if ds == w, the pattern does not need to be translated
+ * if ds == 0 (or FADER_RESERVE), the pattern needs to be moved
+ * w to the left, which is -w in pattern space, and w in user space
+ * if ds == 10, then the pattern needs to be moved w - 10
+ * to the left, which is -(w-10) in pattern space, which
+ * is (w - 10) in user space
+ * thus: translation = (w - ds)
+ */
+
+ if (!CairoWidget::flat_buttons() ) {
+ cairo_set_source (cr, _pattern);
+ cairo_matrix_init_translate (&matrix, w - ds, 0);
+ cairo_pattern_set_matrix (_pattern, &matrix);
+ } else {
+ CairoWidget::set_source_rgb_a (cr, get_style()->get_bg (get_state()), 1);
+ cairo_fill (cr);
+ CairoWidget::set_source_rgb_a (cr, get_style()->get_fg (get_state()), 1);
+ Gtkmm2ext::rounded_rectangle (cr, CORNER_OFFSET, CORNER_OFFSET,
+ ds - CORNER_SIZE, h - CORNER_SIZE, CORNER_RADIUS);
+ }
+ cairo_fill (cr);
+ }
+
+ /* draw the unity-position line if it's not at either end*/
+ if (!(_tweaks & NoShowUnityLine) && _unity_loc > CORNER_RADIUS) {
+ cairo_set_line_width(cr, 1);
+ cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
+ Gdk::Color c = get_style()->get_fg (Gtk::STATE_ACTIVE);
+ cairo_set_source_rgba (cr, c.get_red_p() * 1.5, c.get_green_p() * 1.5, c.get_blue_p() * 1.5, 0.85);
+ if (_orien == VERT) {
+ if (_unity_loc < h - CORNER_RADIUS) {
+ cairo_move_to (cr, 1.5, _unity_loc + CORNER_OFFSET + .5);
+ cairo_line_to (cr, _girth - 1.5, _unity_loc + CORNER_OFFSET + .5);
+ cairo_stroke (cr);
+ }
+ } else {
+ if (_unity_loc < w - CORNER_RADIUS) {
+ cairo_move_to (cr, _unity_loc - CORNER_OFFSET + .5, 1.5);
+ cairo_line_to (cr, _unity_loc - CORNER_OFFSET + .5, _girth - 1.5);
+ cairo_stroke (cr);
+ }
+ }