All pastes #516516 Raw Edit

Something

public text v1 · immutable
#516516 ·published 2007-05-28 19:04 UTC
rendered paste body
// FIXME: This function needs to be adjusted to match the functionality on the Mac side.
void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSpan)
{
    if (paintingDisabled())
        return;
    
    int x = rect.x();
    int y = rect.y();
    float w = (float)rect.width();
#if 0 // FIXME: unused so far
    float h = (float)rect.height();
    float scaleFactor = h / w;
    float reverseScaleFactor = w / h;
#endif
    cairo_t* context = m_data->context;
    if (strokeStyle() != NoStroke) {        
        float r = w / 2;
        float fa = startAngle;
        float falen =  fa + angleSpan;
        cairo_arc(context, x + r, y + r, r, -fa * M_PI/180, -falen * M_PI/180);
        
        setColor(context, strokeColor());
        cairo_set_line_width(context, strokeThickness());
        cairo_stroke(context);
    }
}