Quantcast
Channel: bugs, errors - openFrameworks
Viewing all articles
Browse latest Browse all 636

ofPath arc rendering glitch

$
0
0

@Ryan_Cashman wrote:

I'm drawing a whole bunch of arcs using ofPath. The side by side images show the problem I'm experiencing. On the left is a saved image using grabScreen. It is exactly what I see while the program is running. The glitch becomes obvious when compared to the image on the right, which is a PDF save of the exact same frame.

The PDF looks correct. I'm trying to figure out why the program is drawing the extra red arcs and fills when running. The code for the draw function is pasted below.

The project is from this processing book, I'm converting it to OF. http://www.generative-gestaltung.de


void SunburstItem::drawArc(float folderScale, float fileScale)
{




float arcRadius;
if (depth > 0)
{
float lineWidth;
if (isDir == 1)
{
lineWidth = (depthWeight * folderScale);
arcRadius = radius + ((depthWeight*folderScale)/2);
}
else {
lineWidth = (depthWeight * fileScale);
arcRadius = radius + ((depthWeight * fileScale)/2);
}
// ofNoFill();
// ofSetColor(color);
//ofPolyline arcPolyLine;
ofPath arcPath;
ofPoint p = ofPoint(ofGetWidth()/2,ofGetHeight()/2);
arcPath.arc(p, arcRadius, arcRadius, angleStart, angleEnd);
arcPath.arcNegative(p, arcRadius+lineWidth, arcRadius+lineWidth, angleEnd, angleStart);
arcPath.close();
arcPath.setCircleResolution(60);
arcPath.setFillColor(color);
arcPath.setFilled(true);
arcPath.draw();
}
}

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 636

Trending Articles