void renderLabels(Cairo::RefPtr<Cairo::Context> cr, std::vector<std::pair<string, FloatPoint> >& toPlace) { cr->save(); cr->set_source_rgba(0.0, 0.0, 0.0, 0.5); Cairo::RefPtr<Cairo::ToyFontFace> font = Cairo::ToyFontFace::create(DEFAULT_FONT, Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_NORMAL); cr->set_font_face(font); cr->set_font_size(120.0); cr->set_line_width(2.0); Cairo::TextExtents textSize; std::list<shared_ptr<Label> > labels; int i = 0; std::vector<shared_ptr<Style>> styles; for (auto& pair : toPlace) { string& text = pair.first; cr->get_text_extents(text, textSize); shared_ptr<Style> s = boost::make_shared<Style>(); s->text = text; styles.push_back(s); FloatPoint center = pair.second + FloatPoint(textSize.width/2.0, textSize.height/2.0); FloatRect owner = FloatRect(center.x, center.y, center.x, center.y); FloatPoint origin = pair.second - FloatPoint(textSize.x_bearing, textSize.y_bearing); shared_ptr<Label> l = boost::make_shared<Label>(FloatRect(pair.second, textSize.width, textSize.height), owner, s->text, s.get(), origin); cr->rectangle(l->box.minX, l->box.minY, l->box.getWidth(), l->box.getHeight()); cr->stroke(); labels.push_back(l); } std::vector<shared_ptr<Label> > placed; placeLabels(labels, placed); for (auto& l: placed) { cr->set_source_rgba(0.0, 0.0, 0.0, 1.0); cr->move_to(l->box.minX, l->box.maxY); cr->show_text(l->style->text.str()); cr->fill(); cr->set_source_rgba(1.0, 0.0, 0.0, 0.5); cr->rectangle(l->box.minX, l->box.minY, l->box.getWidth(), l->box.getHeight()); cr->fill(); } cr->restore(); }
bool TrackOutput::on_expose_event(GdkEventExpose* event) { // This is where we draw on the window Glib::RefPtr<Gdk::Window> window = get_window(); if(window) // Only run if Window does exist { // clip to the area indicated by the expose event so that we only redraw // the portion of the window that needs to be redrawn Cairo::RefPtr<Cairo::Context> cr = window->create_cairo_context(); cr->rectangle(event->area.x, event->area.y, event->area.width, event->area.height); cr->clip(); cr->rectangle(event->area.x, event->area.y, event->area.width, event->area.height); cr->set_source_rgb(0.1 , 0.1 , 0.1 ); cr->fill(); TrackOutputState* state = &stateStore->trackoutputState.at(ID); if ( state->selected ) setColour(cr, COLOUR_GREY_3 ); else setColour(cr, COLOUR_GREY_4 ); cr->rectangle(0, 0, 74, 102); cr->fill(); Dial(cr,true, 7,4,state->pan,DIAL_MODE_PAN); // pan Mute(cr, 9 , 41 , state->ID, state->mute ); // mute button Solo(cr, 9 , 68 , state->ID, state->solo ); // solo button Rec (cr, 9 , 85 , state->ID, state->recEnable); // rec button Fader(cr,46 , 4 , state->volume, state->rms, state->falloff ); // fader if ( state->selected ) { cr->rectangle(0, -10, 74, 200); setColour( cr, COLOUR_PURPLE_1 ); cr->set_line_width(1); cr->stroke(); } } return true; }
void Anchor::draw(const Cairo::RefPtr<Cairo::Context>& context) const { context->save(); context->move_to(mX,mY); context->set_source_rgb(0., 1., 0.); context->rectangle(mX, mY, ANCHOR_WIDTH, ANCHOR_HEIGHT); context->fill(); context->restore(); }
void DependencyArrow::draw(const Cairo::RefPtr<Cairo::Context>& context) const { // the way to compute the (tcx, tcy) single control point of the // quadratic double dX = mControlPoint.getX() - mOrigin->getX(); double dY = mControlPoint.getY() - mOrigin->getY(); double d1 = std::sqrt(dX * dX + dY * dY); double d = d1; dX = mDestination->getX() - mControlPoint.getX(); dY = mDestination->getY() - mControlPoint.getY(); d += std::sqrt(dX * dX + dY * dY); double t = d1/d; double t1 = 1.0 - t; double tSq = t * t; double denom = 2.0 * t * t1; double tcx = (mControlPoint.getX() - t1 * t1 * mOrigin->getX() - tSq * mDestination->getX()) / denom; double tcy = (mControlPoint.getY() - t1 * t1 * mOrigin->getY() - tSq * mDestination->getY()) / denom; // from the single point of the quadratic to the both of the cubic double tcxq1 = mOrigin->getX() + 2. * (tcx - mOrigin->getX()) / 3.; double tcyq1 = mOrigin->getY() + 2. * (tcy - mOrigin->getY()) / 3.; double tcxq2 = mDestination->getX() + 2. * (tcx - mDestination->getX()) / 3.; double tcyq2 = mDestination->getY() + 2. * (tcy - mDestination->getY()) / 3.; // and now to draw, std::valarray< double > dashes(2); double angle = atan2 (mDestination->getY() - tcyq2, mDestination->getX() - tcxq2) + M_PI; double x1 = mDestination->getX() + 9 * std::cos(angle - 0.35); double y1 = mDestination->getY() + 9 * std::sin(angle - 0.35); double x2 = mDestination->getX() + 9 * std::cos(angle + 0.35); double y2 = mDestination->getY() + 9 * std::sin(angle + 0.35); dashes[0] = 8.0; dashes[1] = 3.0; context->save(); context->set_line_width(1); context->move_to(mDestination->getX(), mDestination->getY()); context->line_to(x1,y1); context->line_to(x2,y2); context->line_to(mDestination->getX(), mDestination->getY()); context->fill(); context->set_dash(dashes,0.); context->move_to(mOrigin->getX(), mOrigin->getY()); context->curve_to(tcxq1, tcyq1, tcxq2, tcyq2, mDestination->getX(), mDestination->getY()); context->stroke(); context->restore(); }
void Simple_GOL_Area::draw_background(const Cairo::RefPtr<Cairo::Context>& cr) { Gtk::Allocation allocation = get_allocation(); const int width = allocation.get_width(); const int height = allocation.get_height(); cr->set_source_rgb(0,0,0); cr->rectangle(0, 0, width, height); cr->fill(); }
void GraficoDeTorta::dibujarArco(const Cairo::RefPtr<Cairo::Context>& c,int x, int y, int radio, float angulo0, float angulo1,float r, float g, float b){ c->set_source_rgb(1,1,1); c->set_line_width(2); c->arc(x,y,radio, angulo0, angulo1); c->line_to(x,y); c->close_path(); c->stroke_preserve(); c->set_source_rgb(r,g,b); c->fill(); }
void ListNode::draw_node(const Cairo::RefPtr<Cairo::Context> & cr, int x, int y) { cr->rectangle(x, y, field_w, field_h * numFields); cr->fill(); cr->set_source_rgb(0.0, 0.0, 0.0); cr->set_line_width(2.0); for (int i = 0; i < numFields; i++) { cr->rectangle(x, y + (i * field_h), field_w, field_h); cr->stroke(); } }
// ---------------------------------------------------------------------------- // -- Function : draw_bar(cr) // -- // -- Takes : cr = point to a cairo reference // -- // -- Purpose : Assumes value is already between 1 and 0! Draws the bar // on the provided cairo reference. void BarWidget::draw_bar(Cairo::RefPtr<Cairo::Context> cr) { // Get our bar coords Size size = get_avail_rect(); Size* s = &size; // Draw the bg first cr->set_line_width(bar_bg_border_width); cr->rectangle(s->x, s->y, s->width, s->height); // -- bg border if (draw_bar_bg_border) { bar_bg_border_color->set_source(cr); cr->stroke_preserve(); } // -- bg if (draw_bar_bg) { bar_bg_color->set_source(cr); cr->fill_preserve(); } // Clear the path cr->begin_new_path(); // -- Now we're drawing the value bar // Modify the size by our value / percent // If we're horz, modify the width. // If we're vert, modify the height. if (vertical) s->height = s->height * m_value; else s->width = s->width * m_value; // New path, draw! cr->set_line_width(bar_border_width); cr->rectangle(s->x, s->y, s->width, s->height); // -- bar border if (draw_bar_border) { bar_border_color->set_source(cr); cr->stroke_preserve(); } // -- Draw the bar bar_color->set_source(cr); cr->fill(); // clean up cr->begin_new_path(); s = nullptr; }
bool MyArea_private::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { if (pixbuf == 0) return false; cr->set_source_rgba(0xff, 0xff, 0xff, 0xff); cr->rectangle(0, 0, 800, 640); cr->fill(); Gdk::Cairo::set_source_pixbuf(cr, pixbuf); cr->paint(); cr->stroke(); return true; }
void ItemView::drawButton(const Cairo::RefPtr<Cairo::Context>& cr, Gtk::Image* image, Gdk::Rectangle rect) { const Glib::RefPtr<Gdk::Pixbuf> icon = image->get_pixbuf(); const int iconLeft = rect.get_x() + (rect.get_width() * 0.5) - (icon->get_width() * 0.5); const int iconTop = rect.get_y() + (rect.get_height() * 0.5) - (icon->get_height() * 0.5); Gdk::Cairo::set_source_pixbuf(cr, icon, iconLeft, iconTop); cr->rectangle(iconLeft, iconTop, icon->get_width(), icon->get_height()); cr->fill(); }
void HelloWorld::update_canvas(Cairo::RefPtr<Cairo::Context> &context) { alc_allocation = ara_canvas.get_allocation(); int width = alc_allocation.get_width(); int height = alc_allocation.get_height(); cout << "width: " << width << ", height: " << height << endl; context->save(); context->set_source_rgba(0, level, 0, 1); context->scale(width, height); context->rectangle(0, 0, 1, 1); context->fill(); context->restore(); }
void Rect::draw(Cairo::RefPtr<Cairo::Context> cr, int x, int y) { //draw a Rectangle centered on (x, y) int w_2 = width/2; int h_2 = height/2; cr->save(); cr->rectangle(x - w_2, y - h_2, width, height); cr->set_source_rgba(color->getRed(), color->getGreen(), color->getBlue(), 1.0); //opaque cr->fill(); cr->restore(); }
bool on_expose_event(GdkEventExpose* ev ){ Glib::RefPtr< Gdk::Window > v = get_window(); if (v) { Cairo::RefPtr< Cairo::Context > ctx = v->create_cairo_context(); Gtk::Allocation alloc = get_allocation(); const int altura = alloc.get_height(); const int ancho = alloc.get_width(); ctx->set_source_rgb(0.3, 0.1, 0.4); ctx->scale(ancho, altura); ctx->rectangle(1.0 / 2.0, 1.0 / 4.0, 1.0 / 5.0, 1.0 / 5.0); ctx->fill(); } return true; }
void NodeSurface::FillBackground( Cairo::RefPtr<Cairo::Context> refCairo, double red, double green, double blue ) { // Get width / height of surface int surfaceWidth = m_surface->get_width(); int surfaceHeight = m_surface->get_height(); refCairo->set_source_rgb( red, green, blue ); refCairo->rectangle( 0, 0, surfaceWidth, surfaceHeight ); refCairo->fill(); }
void BezierPath::Invocation::draw(const Cairo::RefPtr<Cairo::Context> & cr) { if (!path) return; //Execute the bezier path. path->execute(cr); //Stroke, fill or do both. if (stroke && fill) { cr->fill_preserve(); cr->stroke(); } else if (stroke) cr->stroke(); else if (fill) cr->fill(); }
bool MainWindow::first_draw(const Cairo::RefPtr<Cairo::Context>& cr) { Gtk::Allocation allocation = m_first.get_allocation(); cr->set_source_rgba(0, 0, 0, 1); cr->rectangle(0, 0, allocation.get_width(), allocation.get_height()); cr->fill(); if(m_png) { cr->set_source(m_png, 0, 0); cr->paint(); } return true; }
void NodeRenderer::casing(const Cairo::RefPtr<Cairo::Context>& cr) { // nothing to render if (s->casing_width <= 0.0) return; cr->save(); cr->arc(location.x, location.y, s->width/2.0 + s->casing_width, 0, 2*boost::math::constants::pi<double>()); cr->set_source_color(s->casing_color); cr->fill(); cr->restore(); }
void NodeRenderer::stroke(const Cairo::RefPtr<Cairo::Context>& cr) { // nothing to stroke if (s->width <= 0.0) return; cr->save(); cr->arc(location.x, location.y, s->width/2.0, 0, 2*M_PI); cr->set_source_color(s->color); cr->fill(); cr->restore(); }
bool rasterpolys(const vector<Poly> &polys, const Vector2d &min, const Vector2d &max, double resolution, Cairo::RefPtr<Cairo::ImageSurface> &surface, Cairo::RefPtr<Cairo::Context> &context) { Vector2d diag = max - min; int width = (int)ceil(diag.x()/resolution); int height = (int)ceil(diag.y()/resolution); if (height <= 0 || width <= 0) return false; surface = Cairo::ImageSurface::create(Cairo::FORMAT_A8, width, height); //surface->set_device_offset(-min.x()/resolution, -min.y()/resolution); context = Cairo::Context::create (surface); context->set_fill_rule(Cairo::FILL_RULE_WINDING); context->set_antialias(Cairo::ANTIALIAS_DEFAULT); context->scale(1/resolution, 1/resolution); context->translate(-min.x(), -min.y()); context->set_source_rgb (0,0,0); //cerr << min << endl <<getMatrix(context) << endl; // draw boundary // context->begin_new_path(); // context->set_line_width(0.5); // context->move_to(min.x(),min.y()); // context->line_to(max.x(),min.y()); // context->line_to(max.x(),max.y()); // context->line_to(min.x(),max.y()); // // context->move_to(0,0); // // context->line_to(diag.x(),0); // // context->line_to(diag.x(),diag.y()); // // context->line_to(0,diag.y()); // context->close_path(); // context->stroke(); context->begin_new_path(); context->set_line_width(0); for (uint i=0; i<polys.size(); i++) { Vector2d v = polys[i][0]; context->move_to(v.x(),v.y()); for (uint j=0; j<polys[i].size(); j++) { Vector2d v = polys[i][j]; context->line_to(v.x(),v.y()); } } context->fill(); return true; }
/** \brief Signal handler. \param cr is a pointer to the cairo context \return always true Draws population development (of preys and predators) in the cairo context object. */ bool Graph::on_draw (const Cairo::RefPtr<Cairo::Context> &cr) { int w = get_width(); int h = get_height(); if (_is_enabled) { cr->save(); cr->rectangle(0, 0, w, h); cr->set_source_rgb(1, 1, 1); cr->fill(); Bounded<TValues::size_type> startb(0, 0, _values[PREY].size()); Bounded<TValues::size_type> stopb(0, 0, _values[PREY].size()); TValues::size_type start = 0; TValues::size_type stop = 0; if (_cont_zoom) { stop = _values[PREY].size(); start = 0; } else { if (_cont_pos) { stopb = _values[PREY].size(); start = (stopb - _visible_range).get_value(); stop = start + _visible_range; } else { start = _visible_position; stop = start + _visible_range; } } draw_line(cr, _values[PREY], _max_values[PREY], start, stop); cr->set_source_rgb(0, 0, 0); cr->stroke(); draw_line(cr, _values[PREDATOR], _max_values[PREDATOR], start, stop); cr->set_source_rgb(1, 0, 0); cr->stroke(); cr->restore(); } return true; }
void ItemView::drawInnerShadow(const Cairo::RefPtr<Cairo::Context>& cr, const int width, const int height) { cr->set_antialias(Cairo::ANTIALIAS_DEFAULT); const int SIZE = height * 0.1; const double ALPHA = 0.2; const int x = TIME_WIDTH - SIZE; const int y = 0; Cairo::RefPtr<Cairo::LinearGradient> linearGradient = Cairo::LinearGradient::create(x, y, x + SIZE, y); linearGradient->add_color_stop_rgba(0, 0.00, 0.00, 0.00, 0.0); linearGradient->add_color_stop_rgba(1, 0.00, 0.00, 0.00, ALPHA); cr->set_source(linearGradient); cr->rectangle(x, y, SIZE, height); cr->fill(); }
void Turtle::triangle(Cairo::RefPtr<Cairo::Context> cr, double x, double y, double size, double a) { cr->save(); // cr->set_source_rgb(0, 0, 0); /* if (first) { first = false; sand->set_source_rgb(0, 0, 1); } */ cr->move_to(x + size * cosd(a), y + size * sind(a)); cr->line_to(x + size * cosd(a + 120), y + size * sind(a + 120)); cr->line_to(x + size * cosd(a + 240), y + size * sind(a + 240)); cr->fill(); cr->close_path(); cr->stroke(); cr->restore(); colored_area += sqrt(3) / 2 * size * size; }
int main(int, char**) { Cairo::RefPtr<Cairo::ImageSurface> surface = Cairo::ImageSurface::create( Cairo::FORMAT_ARGB32, WIDTH, HEIGHT); Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create(surface); // fill background in white cr->set_source_rgb(1.0, 1.0, 1.0); cr->paint(); // draw a little dot at the point where text will be drawn cr->arc(TEXT_ORIGIN_X, TEXT_ORIGIN_Y, FONT_SIZE / 4.0, 0, 2 * M_PI); cr->set_source_rgba(0.0, 1.0, 0.0, 0.5); cr->fill(); // draw the text cr->move_to(TEXT_ORIGIN_X, TEXT_ORIGIN_Y); cr->set_source_rgb(0.8, 0.2, 0.2); Cairo::RefPtr<BoxFontFace> font = BoxFontFace::create(); cr->set_font_face(font); cr->set_font_size(FONT_SIZE); cr->show_text("cairomm!"); // Now show it with the toy text API to // demonstrate how the glyphs match up cr->move_to(TEXT_ORIGIN_X, TEXT_ORIGIN_Y); cr->set_source_rgba(0.2, 0.2, 0.2, 0.3); Cairo::RefPtr<Cairo::ToyFontFace> toy_font = Cairo::ToyFontFace::create( "Bitstream Charter", Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_BOLD); cr->set_font_face(toy_font); cr->set_font_size(FONT_SIZE); cr->show_text("cairomm!"); const char* filename = "user-font.png"; try { surface->write_to_png(filename); std::cout << "Wrote Image " << filename << std::endl; return 0; } catch (const std::exception& e) { std::cout << "** Unable to write Image " << filename << std::endl; return 1; } }
void TitleBar( Cairo::RefPtr<Cairo::Context> cr, float x, float y, float xS, float yS, std::string name, bool active) { if ( active ) setColour(cr, COLOUR_GREEN_1 ); else setColour(cr, COLOUR_GREY_1 ); cr->rectangle(x,y, xS, 15); cr->set_line_width(2.8); cr->fill(); cr->select_font_face ("Impact" , Cairo::FONT_SLANT_NORMAL, Cairo::FONT_WEIGHT_NORMAL); cr->set_font_size ( 13 ); cr->move_to ( x + 8, y + 13 ); cr->set_source_rgb( 0 / 255.f, 0/255.f , 0/255.f ); cr->show_text ( name ); //std::cout << "LupppWidget::TitleBar() called!" << std::endl; }
/** * Draws a curve for the speed graph. */ void GtkGraph::draw(std::queue<double> q, double height, double increment, double maxValue, const Cairo::RefPtr<Cairo::Context>& cr) { // wizards use computers // computers use numbers // no magic double offset = increment * (m_displaySize - q.size()); cr->move_to(0, height); for(unsigned i = 0; i< (m_displaySize - q.size());++i) cr->line_to(i*increment, height); double oldy; if(q.empty()) return; oldy = height - (q.front() * height / maxValue); cr->line_to(offset, oldy); q.pop(); double x = increment + offset; while(!q.empty()) { double y = height - (q.front() * height / maxValue); cr->curve_to(x - increment/2, oldy, x - increment/2, y, x, y); q.pop(); oldy = y; x += increment; } if(gt::Settings::settings["GraphStyle"] == "Fill") { cr->stroke_preserve(); Gdk::Cairo::set_source_rgba(cr, Gdk::RGBA(gt::Settings::settings[(upl) ? "GraphUploadFillColor" : "GraphDownloadFillColor"])); cr->line_to(x - increment, height); cr->line_to(0,height); auto k = Gdk::RGBA(gt::Settings::settings[(upl) ? "GraphUploadFillColor" : "GraphDownloadFillColor"]); cr->set_source_rgba(k.get_red(), k.get_green(), k.get_blue(), k.get_alpha() * 0.5); cr->fill(); } else cr->stroke(); }
bool level_editor::tileset_display::on_expose_event(GdkEventExpose* event) { Glib::RefPtr<Gdk::Window> window = get_window(); if (!window || !m_surface) return true; Cairo::RefPtr<Cairo::Context> cr = window->create_cairo_context(); cr->rectangle(event->area.x, event->area.y, event->area.width, event->area.height); cr->clip(); cr->set_source(m_surface, 0, 0); cr->paint(); // Show selection rectangle when we are selecting if (m_selecting || ((m_select_x != m_select_end_x || m_select_y != m_select_end_y) && m_preferences.sticky_tile_selection)) { const int x = std::min(m_select_x, m_select_end_x) * m_tile_width; const int y = std::min(m_select_y, m_select_end_y) * m_tile_height; const int w = (std::abs(m_select_x - m_select_end_x)) * m_tile_width; const int h = (std::abs(m_select_y - m_select_end_y)) * m_tile_height; cr->save(); cr->rectangle(x, y, w, h); // TODO: move selection color somewhere else (preferences?) cr->set_source_rgb(0.7, 1, 1); if (m_preferences.selection_background) { cr->stroke_preserve(); cr->set_source_rgba(0.7, 1, 0, 0.2); cr->fill(); } else { cr->stroke(); } cr->restore(); } return true; }
void ColorMenuToolButtonBase::drawColorRectangle(const Cairo::RefPtr< Cairo::Context > context, double x, double y, double w, double h) { if (has_color_) { context->rectangle (0, getImageHeight() - 5, getImageWidth(), 5); #ifdef GTKMM_3 selected_color_.useInCairo (context); #else selected_color_.useInCairoRev (context); #endif context->fill(); } else { context->set_line_width (1.0); context->rectangle (0.5, getImageHeight() - 4.5, getImageWidth() - 0.5, 5 - 0.5); context->set_source_rgb (0, 0, 0); context->stroke(); } }
void thin_rotor::draw(Cairo::RefPtr<Cairo::Context> cr) { cr->save(); // Draw rotor window rectangle cr->set_source_rgb(red, green, blue); cr->set_line_width(1.0); cr->rectangle(x - width / 2, y - height / 2, width, height); cr->fill(); cr->stroke(); cr->restore(); cr->save(); // Draw rotor position cr->set_source_rgb(BLACK); print_char(cr, x, y, wheel_pos, width - 2); cr->restore(); }
bool InfoWidget::drawChart(const::Cairo::RefPtr<Cairo::Context> &context) { context->save(); const double width = m_chartDrawingArea.get_allocation().get_width(); const double height = m_chartDrawingArea.get_allocation().get_height(); context->set_source_rgb(m_data.color.get_red(), m_data.color.get_green(), m_data.color.get_blue()); context->rectangle(0, 0, width, height); context->fill(); const Gdk::RGBA color = get_style_context()->get_color(); context->set_source_rgb(color.get_red(), color.get_green(), color.get_blue()); const double titleX = width / 2.0; const double titleY = height / 2.0; auto layout = Pango::Layout::create(context); layout->set_justify(true); layout->set_alignment(Pango::ALIGN_CENTER); if (m_data.subtitle.empty()) layout->set_markup(m_data.title); else layout->set_markup(m_data.title + "\n<span size=\"x-small\">" + m_data.subtitle + "</span>"); auto fontDescription = get_style_context()->get_font(); fontDescription.set_size(2 * fontDescription.get_size()); layout->set_font_description(fontDescription); const auto rectangle = layout->get_pixel_logical_extents(); context->translate(titleX - rectangle.get_width() / 2.0, titleY - rectangle.get_height() / 2.0); layout->show_in_cairo_context(context); context->restore(); return true; }
/** * Does something when the block bar is drawn. */ bool GtkBlockBar::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) { const double width = (double)get_allocation().get_width(); const double height = (double)get_allocation().get_height(); double increment = width / (double)m_blocks.size(); for(unsigned i = 0; i < m_blocks.size(); ++i) { if(m_blocks[i]) Gdk::Cairo::set_source_rgba(cr, get_style_context()->get_color()); else Gdk::Cairo::set_source_rgba(cr, get_style_context()->get_background_color()); double start = i * increment; cr->rectangle(start, 0, increment, height); cr->stroke_preserve(); cr->fill(); } return true; }